On 11/02/14(Tue) 19:40, Alexander Bluhm wrote:
> On Tue, Feb 11, 2014 at 03:53:24PM +0100, Martin Pieuchot wrote:
> > When a carp node sends a neighbor advertisement, because its status
> > switch from BACKUP to MASTER for example, it does it using a wrong
> > mac address: the one from its real associated interface (carpdev).
> > 
> > Because of this, a hack was added later on to remove and re-add the
> > route entry to loopback for the local IPv6 address, otherwise this
> > entry would be updated on the BACKUP node with the MAC address of
> > the physical interface on the MASTER node!
> > 
> > So this diff fix this by using the carp interface to send the NA and
> > also change it for the ARP request for consistency.
> 
> There is the ip-stealth mode where the switch must not see the
> virtual MAC address to make it flooding.  An ARP or ND packet with
> the CARP MAC as source address would break the feature.

This diff doesn't change anything on this regard.  It changes the target
link-layer address send inside the NA to be the CARP MAC address and not
the physical interface's one.

Without it I get:
icmp6: neighbor adv: tgt is ...(RO)(tgt lladdr: 00:00:14:ee:43:71)
                                                ^^^^^^^^^^^^^^^^^
                                              MAC addr. of carpdev

And with it:
icmp6: neighbor adv: tgt is ...(RO)(tgt lladdr: 00:00:5e:00:01:03)
                                                ^^^^^^^^^^^^^^^^^
                                                CARP MAC addr

So ok?

> > Index: netinet/ip_carp.c
> > ===================================================================
> > RCS file: /home/ncvs/src/sys/netinet/ip_carp.c,v
> > retrieving revision 1.221
> > diff -u -p -r1.221 ip_carp.c
> > --- netinet/ip_carp.c       7 Feb 2014 22:22:37 -0000       1.221
> > +++ netinet/ip_carp.c       11 Feb 2014 13:53:16 -0000
> > @@ -509,17 +509,6 @@ carp_setroute(struct carp_softc *sc, int
> >                     }
> >                     break;
> >             }
> > -
> > -#ifdef INET6
> > -           case AF_INET6:
> > -                   if (sc->sc_balancing >= CARP_BAL_IP)
> > -                           continue;
> > -                   if (cmd == RTM_ADD)
> > -                           in6_ifaddloop(ifa);
> > -                   else
> > -                           in6_ifremloop(ifa);
> > -                   break;
> > -#endif /* INET6 */
> >             default:
> >                     break;
> >             }
> > @@ -1330,7 +1319,7 @@ carp_send_arp(struct carp_softc *sc)
> >                     continue;
> >  
> >             in = ifatoia(ifa)->ia_addr.sin_addr.s_addr;
> > -           arprequest(sc->sc_carpdev, &in, &in, sc->sc_ac.ac_enaddr);
> > +           arprequest(&sc->sc_if, &in, &in, sc->sc_ac.ac_enaddr);
> >             DELAY(1000);    /* XXX */
> >     }
> >     splx(s);
> > @@ -1351,7 +1340,7 @@ carp_send_na(struct carp_softc *sc)
> >                     continue;
> >  
> >             in6 = &ifatoia6(ifa)->ia_addr.sin6_addr;
> > -           nd6_na_output(sc->sc_carpdev, &mcast, in6,
> > +           nd6_na_output(&sc->sc_if, &mcast, in6,
> >                 ND_NA_FLAG_OVERRIDE |
> >                 (ip6_forwarding ? ND_NA_FLAG_ROUTER : 0), 1, NULL);
> >             DELAY(1000);    /* XXX */

Reply via email to