OSDN Git Service

seltests: bpf: test_tunnel: Use ip neigh
authorJiri Benc <jbenc@redhat.com>
Tue, 21 Sep 2021 14:59:11 +0000 (16:59 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 22 Sep 2021 03:40:16 +0000 (20:40 -0700)
The 'arp' command is deprecated and is another dependency of the selftest.
Just use 'ip neigh', the test depends on iproute2 already.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/40f24b9d3f0f53b5c44471b452f9a11f4d13b7af.1632236133.git.jbenc@redhat.com
tools/testing/selftests/bpf/test_tunnel.sh

index 1ccbe80..ca13729 100755 (executable)
@@ -168,14 +168,15 @@ add_vxlan_tunnel()
        ip netns exec at_ns0 \
                ip link set dev $DEV_NS address 52:54:00:d9:01:00 up
        ip netns exec at_ns0 ip addr add dev $DEV_NS 10.1.1.100/24
-       ip netns exec at_ns0 arp -s 10.1.1.200 52:54:00:d9:02:00
+       ip netns exec at_ns0 \
+               ip neigh add 10.1.1.200 lladdr 52:54:00:d9:02:00 dev $DEV_NS
        ip netns exec at_ns0 iptables -A OUTPUT -j MARK --set-mark 0x800FF
 
        # root namespace
        ip link add dev $DEV type $TYPE external gbp dstport 4789
        ip link set dev $DEV address 52:54:00:d9:02:00 up
        ip addr add dev $DEV 10.1.1.200/24
-       arp -s 10.1.1.100 52:54:00:d9:01:00
+       ip neigh add 10.1.1.100 lladdr 52:54:00:d9:01:00 dev $DEV
 }
 
 add_ip6vxlan_tunnel()