From: Roy Marples Date: Tue, 14 Nov 2017 12:16:26 +0000 (+0000) Subject: BSD: Strip scope from link-local addresses for KAME stacks X-Git-Tag: v7.0.0-rc4~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25245493b9dae458d5ada26bfb43d7df9d49dd38;p=thirdparty%2Fdhcpcd.git BSD: Strip scope from link-local addresses for KAME stacks This fixes DHCPv6 and IPv6ND trying to send messages from DETACHED or TENTATIVE addresses when carrier comes back. --- diff --git a/src/if-bsd.c b/src/if-bsd.c index 5dcdc71b..b5bb667d 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -1164,6 +1164,12 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam) } #endif +#ifdef __KAME__ + if (IN6_IS_ADDR_LINKLOCAL(&addr6)) + /* Remove the scope from the address */ + addr6.s6_addr[2] = addr6.s6_addr[3] = '\0'; +#endif + ipv6_handleifa(ctx, ifam->ifam_type, NULL, ifp->name, &addr6, ipv6_prefixlen(&mask6), addrflags); break;