]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: fix XDP_FLAGS_SKB_MODE detach for xdp_tx_iptunnel
authorJesper Dangaard Brouer <brouer@redhat.com>
Mon, 1 May 2017 09:26:20 +0000 (11:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 May 2017 14:42:37 +0000 (10:42 -0400)
commite6a4cb40a966363ac74b58a24606ce8338d323be
treeb101f0cb75d4d3d75880286c36d95951ad94edd6
parent7fdab87459825e43a6908f8778e252e1ea44029c
samples/bpf: fix XDP_FLAGS_SKB_MODE detach for xdp_tx_iptunnel

The xdp_tx_iptunnel program can be terminated in two ways, after
N-seconds or via Ctrl-C SIGINT.  The SIGINT code path does not
handle detatching the correct XDP program, in-case the program
was attached with XDP_FLAGS_SKB_MODE.

Fix this by storing the XDP flags as a global variable, which is
available for the SIGINT handler function.

Fixes: 842efb6c1dda ("samples/bpf: Add support for SKB_MODE to xdp1 and xdp_tx_iptunnel")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/xdp_tx_iptunnel_user.c