diff options
author | David S. Miller | 2017-05-01 10:42:38 -0400 |
---|---|---|
committer | David S. Miller | 2017-05-01 10:42:38 -0400 |
commit | edd7f4efa8111efc279582290acc4d54d405748a (patch) | |
tree | b101f0cb75d4d3d75880286c36d95951ad94edd6 /samples/bpf/xdp_tx_iptunnel_user.c | |
parent | d74a32acd59a8ccd8e209af3f4cf533e0359d355 (diff) | |
parent | f76254a845a661ccdb9fa246ee72197f90a8d3dd (diff) |
Merge branch 'bpf-samples-skb_mode-bug-fixes'
Jesper Dangaard Brouer says:
====================
samples/bpf: two bug fixes to XDP_FLAGS_SKB_MODE attaching
Two small bugfixes for:
commit 3993f2cb983b ("samples/bpf: Add support for SKB_MODE to xdp1 and xdp_tx_iptunnel")
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/xdp_tx_iptunnel_user.c')
-rw-r--r-- | samples/bpf/xdp_tx_iptunnel_user.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/samples/bpf/xdp_tx_iptunnel_user.c b/samples/bpf/xdp_tx_iptunnel_user.c index cb2bda7b5346..92b8bde9337c 100644 --- a/samples/bpf/xdp_tx_iptunnel_user.c +++ b/samples/bpf/xdp_tx_iptunnel_user.c @@ -25,11 +25,12 @@ #define STATS_INTERVAL_S 2U static int ifindex = -1; +static __u32 xdp_flags = 0; static void int_exit(int sig) { if (ifindex > -1) - set_link_xdp_fd(ifindex, -1, 0); + set_link_xdp_fd(ifindex, -1, xdp_flags); exit(0); } @@ -143,7 +144,6 @@ int main(int argc, char **argv) struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; struct vip vip = {}; char filename[256]; - int flags = 0; int opt; int i; @@ -204,7 +204,7 @@ int main(int argc, char **argv) kill_after_s = atoi(optarg); break; case 'S': - flags |= XDP_FLAGS_SKB_MODE; + xdp_flags |= XDP_FLAGS_SKB_MODE; break; default: usage(argv[0]); @@ -248,14 +248,14 @@ int main(int argc, char **argv) } } - if (set_link_xdp_fd(ifindex, prog_fd[0], flags) < 0) { + if (set_link_xdp_fd(ifindex, prog_fd[0], xdp_flags) < 0) { printf("link set xdp fd failed\n"); return 1; } poll_stats(kill_after_s); - set_link_xdp_fd(ifindex, -1, flags); + set_link_xdp_fd(ifindex, -1, xdp_flags); return 0; } |