From 6acf89638bf29c9d2cfb782ec752b35a418e921b Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 11 Oct 2022 00:36:30 +0200 Subject: netlink: Disable duplicate address detection for configured IPv6 address 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 Reviewed-by: David Gibson --- 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); -- cgit v1.2.3