From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 66D3F5A0267; Tue, 11 Oct 2022 01:33:08 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] netlink: Disable duplicate address detection for configured IPv6 address Date: Tue, 11 Oct 2022 01:33:08 +0200 Message-Id: <20221010233308.1198341-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: X3KWR52WXVWPCFL6PGZYP2K4CGR3MPK3 X-Message-ID-Hash: X3KWR52WXVWPCFL6PGZYP2K4CGR3MPK3 X-MailFrom: sbrivio@passt.top 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 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: 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. With a different configured address, that's not the case, but anyway duplicate address detection will be unable to see this. In both cases, we're wasting time for nothing. Pass the IFA_F_NODAD flag as we configure globally scoped IPv6 addresses via netlink. Signed-off-by: Stefano Brivio --- netlink.c | 3 +++ 1 file changed, 3 insertions(+) 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 == AF_INET6) { size_t rta_len = RTA_LENGTH(sizeof(req.set.a6.l)); + /* By default, strictly speaking, it's duplicated */ + req.ifa.ifa_flags = IFA_F_NODAD; + req.nlh.nlmsg_len = offsetof(struct req_t, set.a6) + sizeof(req.set.a6); -- 2.35.1