BPF Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH bpf-next] selftests/bpf: Omit nodad flag when adding addresses to loopback
@ 2020-07-30 12:53 Jakub Sitnicki
  2020-07-30 19:30 ` Andrii Nakryiko
  2020-07-31  0:06 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Sitnicki @ 2020-07-30 12:53 UTC (permalink / raw)
  To: bpf
  Cc: netdev, kernel-team, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko

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")
Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
 tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
index 9bbd2b2b7630..379da6f10ee9 100644
--- a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
+++ b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
@@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Omit nodad flag when adding addresses to loopback
  2020-07-30 12:53 [PATCH bpf-next] selftests/bpf: Omit nodad flag when adding addresses to loopback Jakub Sitnicki
@ 2020-07-30 19:30 ` Andrii Nakryiko
  2020-07-31  0:06 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2020-07-30 19:30 UTC (permalink / raw)
  To: Jakub Sitnicki
  Cc: bpf, Networking, kernel-team, Alexei Starovoitov, Daniel Borkmann

On Thu, Jul 30, 2020 at 5:53 AM Jakub Sitnicki <jakub@cloudflare.com> wrote:
>
> 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")
> Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
> ---


This fixes the nodad issue, thanks for quick fix!

Tested-by: Andrii Nakryiko <andrii@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>


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


>  tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
> index 9bbd2b2b7630..379da6f10ee9 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Omit nodad flag when adding addresses to loopback
  2020-07-30 12:53 [PATCH bpf-next] selftests/bpf: Omit nodad flag when adding addresses to loopback Jakub Sitnicki
  2020-07-30 19:30 ` Andrii Nakryiko
@ 2020-07-31  0:06 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-07-31  0:06 UTC (permalink / raw)
  To: Jakub Sitnicki, bpf
  Cc: netdev, kernel-team, Alexei Starovoitov, Andrii Nakryiko

On 7/30/20 2:53 PM, Jakub Sitnicki wrote:
> 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")
> Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 12:53 [PATCH bpf-next] selftests/bpf: Omit nodad flag when adding addresses to loopback Jakub Sitnicki
2020-07-30 19:30 ` Andrii Nakryiko
2020-07-31  0:06 ` Daniel Borkmann

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org
	public-inbox-index bpf

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git