From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 286845A026D for ; Tue, 11 Oct 2022 03:23:57 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4MmdN74nwQz4xG5; Tue, 11 Oct 2022 12:23:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1665451431; bh=MfzSrMGHnIsWydqGcGKgZkNquiWejjXiUztceHjrX0U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ULow2kIqOXHzXjNuIGUJi5BHwKYdQ7X3n9aRkShCGE0kj7Cyj/77jlx6sS4aYM6CE fGe6lLF+0XdxQUjLB1+RznITu+RXu9njGtREdIFZpxkI0bjE8mm4cdnruTAYuftvKM TpR8h8EjhJLo5JliUAdyzLrksJuoASIx9Jh5Fs+Q= Date: Tue, 11 Oct 2022 11:51:42 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] netlink: Disable duplicate address detection for configured IPv6 address Message-ID: References: <20221010233308.1198341-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fYPVnXdD/o1e+kDp" Content-Disposition: inline In-Reply-To: <20221010233308.1198341-1-sbrivio@redhat.com> Message-ID-Hash: YJK25B6KFAWABINKGAXGC7ALRJOP6ERC X-Message-ID-Hash: YJK25B6KFAWABINKGAXGC7ALRJOP6ERC X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --fYPVnXdD/o1e+kDp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 11, 2022 at 01:33:08AM +0200, Stefano Brivio wrote: > With default options, when we pass --config-net, the IPv6 address is > actually going to be recycled from the init namespace, so it is in > fact duplicated, but duplicate address detection has no way to find > out. >=20 > With a different configured address, that's not the case, but anyway > duplicate address detection will be unable to see this. >=20 > In both cases, we're wasting time for nothing. >=20 > Pass the IFA_F_NODAD flag as we configure globally scoped IPv6 > addresses via netlink. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > netlink.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/netlink.c b/netlink.c > index 9719e91..6e5a96b 100644 > --- a/netlink.c > +++ b/netlink.c > @@ -343,6 +343,9 @@ void nl_addr(int ns, unsigned int ifi, sa_family_t af, > if (af =3D=3D AF_INET6) { > size_t rta_len =3D RTA_LENGTH(sizeof(req.set.a6.l)); > =20 > + /* By default, strictly speaking, it's duplicated */ > + req.ifa.ifa_flags =3D IFA_F_NODAD; > + > req.nlh.nlmsg_len =3D offsetof(struct req_t, set.a6) > + sizeof(req.set.a6); > =20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --fYPVnXdD/o1e+kDp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmNEvhgACgkQgypY4gEw YSKNaxAAid0b6dznpzF+TTom/pnYu5CfmLWOgV0qcF5IHyaVujCHMtyT0AbF15VE 8tcCVk8PHz5KuRgUqoqs4QANCID/oO0PZvD9A3FcM6UY/UvbXpS5lhG16obOV+f0 ZEsOh0r1PqKoRm9XG0nrzfrwv9aVuMkzuDT508rV5F/5Prj+kvqID2EL11sCUOxV LzMEyqxrtKFdUGUIh+cOTqRc3lXxGndDQ2wMr7YrK0sGFA7XZW1FNXUT6gcs9v34 rC0F9a0963D6uYpfSbkR+zVTEy1aABmTKeIBDZqaQjGs1B/FvlPb9IbpGujNjmEI tFtG8bqpv4E0CGtnjqI5KDJyJogtYmyD00UbDYOJAPSM9PYrcVMhyBMxk479z3E1 2DnZ6qCRHI8PYGKCzULL+NbqMnU+OnP0HH/wcK9Ch6cBAP+k0fZRuB4j0+pAgUt1 pKBRfUhCGCrzZplvYp+UM9NPKX9xvFnxwhPPknN6jnqUad/e58p5e07ts1ija66j hCCjEcGGadYHWz10UaXqHMQcBhQH00BrQaZOMycY15Wkui8Wh/1RgeEJ3+w9paG+ AkIBzYoVwKFqBWoxNXCiYwjXCqdu0u7L3kRb3/OxCY2r66H7I6dVntyZsWVzU8db 4PRImVPgX0oIdnq6tNv0X0C0vjQBQJ7Mr6RJCd9gyLjg14gfEIQ= =TTnF -----END PGP SIGNATURE----- --fYPVnXdD/o1e+kDp--