After upgrading my carp setup to -current messages like the following
started appearing in the logs of the carp master:

Oct  1 22:09:39 dougal /bsd: nd6_na_input: duplicate IP6 address 
fe80:000a::0200:5eff:fe00:0101
Oct  1 22:09:39 dougal /bsd: nd6_na_input: duplicate IP6 address 
2001:067c:1407:0010::0014

This happens because we now accept neighour advertisements on carp interfaces.
I think we should only send NAs when we're carp master.

Index: nd6_nbr.c
===================================================================
RCS file: /cvs/src/sys/netinet6/nd6_nbr.c,v
retrieving revision 1.57
diff -u -p -r1.57 nd6_nbr.c
--- nd6_nbr.c   26 Jul 2011 21:19:51 -0000      1.57
+++ nd6_nbr.c   2 Oct 2011 11:17:25 -0000
@@ -869,6 +869,7 @@ nd6_na_output(struct ifnet *ifp, struct 
        int icmp6len, maxlen, error;
        caddr_t mac;
        struct route_in6 ro;
+       struct sockaddr_dl *proxydl = NULL;
 
        mac = NULL;
        bzero(&ro, sizeof(ro));
@@ -989,6 +990,12 @@ nd6_na_output(struct ifnet *ifp, struct 
                bcopy(mac, (caddr_t)(nd_opt + 1), ifp->if_addrlen);
        } 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;

Reply via email to