]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: run cleanup routines when receiving SIGTERM
authorAndy Gospodarek <andy@greyhouse.net>
Thu, 11 May 2017 19:52:30 +0000 (15:52 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 May 2017 01:43:30 +0000 (21:43 -0400)
commit3f6cde4eb553899a9d76dad2f63298e31405da8c
treedd21487768f0a759ea6c2432c58e4a459fc9e183
parenta7bcc8b66cac452a73a77a3414ad8bf504e527de
samples/bpf: run cleanup routines when receiving SIGTERM

Shahid Habib noticed that when xdp1 was killed from a different console the xdp
program was not cleaned-up properly in the kernel and it continued to forward
traffic.

Most of the applications in samples/bpf cleanup properly, but only when getting
SIGINT.  Since kill defaults to using SIGTERM, add support to cleanup when the
application receives either SIGINT or SIGTERM.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Reported-by: Shahid Habib <shahid.habib@broadcom.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/cookie_uid_helper_example.c
samples/bpf/offwaketime_user.c
samples/bpf/sampleip_user.c
samples/bpf/trace_event_user.c
samples/bpf/tracex2_user.c
samples/bpf/xdp1_user.c
samples/bpf/xdp_tx_iptunnel_user.c