mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
selftests: forwarding: lib: Allow passing PID to stop_traffic()
Now that it is possible to schedule a deferral of stop_traffic() right after the traffic is started, we do not have to rely on the %% magic to kill the background process that was started last. Instead we can just give the PID explicitly. This makes it possible to start other background processes after the traffic is started without confusing the cleanup. Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
b4b0549a4e
commit
0e07d5dbfb
|
|
@ -1768,8 +1768,10 @@ start_tcp_traffic()
|
|||
|
||||
stop_traffic()
|
||||
{
|
||||
local pid=${1-%%}; shift
|
||||
|
||||
# Suppress noise from killing mausezahn.
|
||||
{ kill %% && wait %%; } 2>/dev/null
|
||||
{ kill $pid && wait $pid; } 2>/dev/null
|
||||
}
|
||||
|
||||
declare -A cappid
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user