summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-11-14 12:16:26 +0000
committerRoy Marples <roy@marples.name>2017-11-14 12:16:26 +0000
commit8a58cee169b9cf96eaac51a9f14a7ac75b81b9fe (patch)
tree5eb9467c6bf94470ce7b6e51a92db0e31b75bc84 /src/if-bsd.c
parentbdbe98f8fc6e4e8188c1c3a0da66abba93a1cefd (diff)
downloaddhcpcd-8a58cee169b9cf96eaac51a9f14a7ac75b81b9fe.tar.xz
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.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c6
1 files changed, 6 insertions, 0 deletions
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;