Skip to contentSkip to conversation

selftests/bpf: Omit nodad flag when adding addresses to loopback

PATCH Applied Jakub Sitnicki 3 participants 3 messages Jul 30, 2020 – Jul 31, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf: Omit nodad flag when adding addresses to loopback

Setting IFA_F_NODAD flag for IPv6 addresses to add to loopback is unnecessary. Duplicate Address Detection does not happen on loopback device.

Also, passing 'nodad' flag to 'ip address' breaks libbpf CI, which runs in an environment with BusyBox implementation of 'ip' command, that doesn't understand this flag.

Fixes 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")
---
 tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/prog_tests/sk_lookup.c +2 -2
index 9bbd2b2b7630..379da6f10ee9 100644
@@ -1290,8 +1290,8 @@ static void run_tests(struct test_sk_lookup *skel)
 static int switch_netns(void)
 {
 	static const char * const setup_script[] = {
-		"ip -6 addr add dev lo " EXT_IP6 "/128 nodad",
-		"ip -6 addr add dev lo " INT_IP6 "/128 nodad",
+		"ip -6 addr add dev lo " EXT_IP6 "/128",
+		"ip -6 addr add dev lo " INT_IP6 "/128",
 		"ip link set dev lo up",
 		NULL,
 	};
Signature · 1 line
2.25.4
Tested-by Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jakub Sitnicki

Setting IFA_F_NODAD flag for IPv6 addresses to add to loopback is unnecessary. Duplicate Address Detection does not happen on loopback device.

Quoted 8 lines

Also, passing 'nodad' flag to 'ip address' breaks libbpf CI, which runs in an environment with BusyBox implementation of 'ip' command, that doesn't understand this flag.

Fixes 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")

---

This fixes the nodad issue, thanks for quick fix!

But now I see these, which seems like you have a separate fix for, right?

(network_helpers.c:112: errno: Cannot assign requested address) Failed to connect to server
run_lookup_test:FAIL:connect_fd_to_fd unexpected result err -1 errno 99 #14 cgroup_skb_sk_lookup:FAIL

udp_recv_send:FAIL:recvmsg failed (/data/users/andriin/linux/tools/testing/selftests/bpf/prog_tests/sk_lookup.c:339:
errno: Resource temporarily unavailable) failed to receive
#73/14 UDP IPv4 redir and reuseport with conns:FAIL

Quoted 21 lines
 tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/prog_tests/sk_lookup.c +2 -3
index 9bbd2b2b7630..379da6f10ee9 100644
@@ -1290,8 +1290,8 @@ static void run_tests(struct test_sk_lookup *skel)
 static int switch_netns(void)
 {
        static const char * const setup_script[] = {
-               "ip -6 addr add dev lo " EXT_IP6 "/128 nodad",
-               "ip -6 addr add dev lo " INT_IP6 "/128 nodad",
+               "ip -6 addr add dev lo " EXT_IP6 "/128",
+               "ip -6 addr add dev lo " INT_IP6 "/128",
                "ip link set dev lo up",
                NULL,
        };
--

2.25.4

maintainer Applied
#2 lore raw
In reply to Jakub Sitnicki
Quoted 11 lines · Jakub Sitnicki

Setting IFA_F_NODAD flag for IPv6 addresses to add to loopback is unnecessary. Duplicate Address Detection does not happen on loopback device.

Also, passing 'nodad' flag to 'ip address' breaks libbpf CI, which runs in an environment with BusyBox implementation of 'ip' command, that doesn't understand this flag.

Fixes 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")

Applied, thanks!