From 74e508cf797e4fdd812fed3b1b1439a6fc00ebfd Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 15 Aug 2024 00:20:00 +0200 Subject: netlink, pasta: Disable DAD for link-local addresses on namespace interface It makes no sense for a container or a guest to try and perform duplicate address detection for their link-local address, as we'll anyway not relay neighbour solicitations with an unspecified source address. While they perform duplicate address detection, the link-local address is not usable, which prevents us from bringing up especially containers and communicate with them right away via IPv6. This is not enough to prevent DAD and reach the container right away: we'll need a couple more patches. As we send NLM_F_REPLACE requests right away, while we still have to read out other addresses on the same socket, we can't use nl_do(): keep track of the last sequence we sent (last address we changed), and deal with the answers to those NLM_F_REPLACE requests in a separate loop, later. Link: https://github.com/containers/podman/pull/23561#discussion_r1711639663 Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- pasta.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pasta.c') diff --git a/pasta.c b/pasta.c index 96545b1..17eed15 100644 --- a/pasta.c +++ b/pasta.c @@ -340,6 +340,12 @@ void pasta_ns_conf(struct ctx *c) } if (c->ifi6) { + rc = nl_addr_set_ll_nodad(nl_sock_ns, c->pasta_ifi); + if (rc < 0) { + warn("Can't set nodad for LL in namespace: %s", + strerror(-rc)); + } + if (c->ip6.no_copy_addrs) { rc = nl_addr_set(nl_sock_ns, c->pasta_ifi, AF_INET6, &c->ip6.addr, 64); -- cgit v1.2.3