summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2011-10-14 16:16:43 +0000
committerstsp <stsp@openbsd.org>2011-10-14 16:16:43 +0000
commit30df48a1209f4b0633d94dfe437e295b63fae78f (patch)
tree072d5ff8f209752c71516a12d2c60ff069c283c5
parentReturn EINVAL when there's no config descriptor for a given index. (diff)
downloadwireguard-openbsd-30df48a1209f4b0633d94dfe437e295b63fae78f.tar.xz
wireguard-openbsd-30df48a1209f4b0633d94dfe437e295b63fae78f.zip
Prevent carp slaves from sending IPv6 neighbour advertisements for carp
addresses. Fixes "duplicate IP6 address" warnings, appearing since we started accepting IPv6 neighbour discovery packets on carp interfaces. ok henning
-rw-r--r--sys/netinet6/nd6_nbr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index f342a1ba52f..ea61ceaf775 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.57 2011/07/26 21:19:51 bluhm Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.58 2011/10/14 16:16:43 stsp Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -869,6 +869,7 @@ nd6_na_output(struct ifnet *ifp, struct in6_addr *daddr6,
int icmp6len, maxlen, error;
caddr_t mac;
struct route_in6 ro;
+ struct sockaddr_dl *proxydl = NULL;
mac = NULL;
bzero(&ro, sizeof(ro));
@@ -990,6 +991,12 @@ nd6_na_output(struct ifnet *ifp, struct in6_addr *daddr6,
} else
flags &= ~ND_NA_FLAG_OVERRIDE;
+#if NCARP > 0
+ /* Do not send NAs for carp addresses if we're not the CARP master. */
+ if (ifp->if_type == IFT_CARP && !carp_iamatch6(ifp, mac, &proxydl))
+ goto bad;
+#endif
+
ip6->ip6_plen = htons((u_short)icmp6len);
nd_na->nd_na_flags_reserved = flags;
nd_na->nd_na_cksum = 0;