diff options
author | William Tu <u9012063@gmail.com> | 2017-07-31 17:40:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-01 01:02:47 -0400 |
commit | cc75f8514db6a3aec517760fccaf954e5b46478c (patch) | |
tree | 57a262222e8843ef9fef2dd3fd2d2c964821ee98 /samples | |
parent | cb891fa6a1d5f52c5f5c07b6f7f4c6d65ea55fc0 (diff) |
samples/bpf: fix bpf tunnel cleanup
test_tunnel_bpf.sh fails to remove the vxlan11 tunnel device, causing the
next geneve tunnelling test case fails. In addition, the geneve reserved bit
in tcbpf2_kern.c should be zero, according to the RFC.
Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/bpf/tcbpf2_kern.c | 4 | ||||
-rwxr-xr-x | samples/bpf/test_tunnel_bpf.sh | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/samples/bpf/tcbpf2_kern.c b/samples/bpf/tcbpf2_kern.c index 9c823a609e75..270edcc149a1 100644 --- a/samples/bpf/tcbpf2_kern.c +++ b/samples/bpf/tcbpf2_kern.c | |||
@@ -147,9 +147,9 @@ int _geneve_set_tunnel(struct __sk_buff *skb) | |||
147 | __builtin_memset(&gopt, 0x0, sizeof(gopt)); | 147 | __builtin_memset(&gopt, 0x0, sizeof(gopt)); |
148 | gopt.opt_class = 0x102; /* Open Virtual Networking (OVN) */ | 148 | gopt.opt_class = 0x102; /* Open Virtual Networking (OVN) */ |
149 | gopt.type = 0x08; | 149 | gopt.type = 0x08; |
150 | gopt.r1 = 1; | 150 | gopt.r1 = 0; |
151 | gopt.r2 = 0; | 151 | gopt.r2 = 0; |
152 | gopt.r3 = 1; | 152 | gopt.r3 = 0; |
153 | gopt.length = 2; /* 4-byte multiple */ | 153 | gopt.length = 2; /* 4-byte multiple */ |
154 | *(int *) &gopt.opt_data = 0xdeadbeef; | 154 | *(int *) &gopt.opt_data = 0xdeadbeef; |
155 | 155 | ||
diff --git a/samples/bpf/test_tunnel_bpf.sh b/samples/bpf/test_tunnel_bpf.sh index 1ff634f187b7..a70d2ea90313 100755 --- a/samples/bpf/test_tunnel_bpf.sh +++ b/samples/bpf/test_tunnel_bpf.sh | |||
@@ -149,6 +149,7 @@ function cleanup { | |||
149 | ip link del veth1 | 149 | ip link del veth1 |
150 | ip link del ipip11 | 150 | ip link del ipip11 |
151 | ip link del gretap11 | 151 | ip link del gretap11 |
152 | ip link del vxlan11 | ||
152 | ip link del geneve11 | 153 | ip link del geneve11 |
153 | pkill tcpdump | 154 | pkill tcpdump |
154 | pkill cat | 155 | pkill cat |