kern/98622: [carp] carp with IPv6 broken on 6.1 (regression)

SUZUKI Shinsuke suz at freebsd.org
Thu Oct 5 20:59:44 PDT 2006


Hi Gavin,

>>>>> On Thu, 27 Jul 2006 16:10:23 GMT
>>>>> gavin.atkinson at ury.york.ac.uk(Gavin Atkinson)  said:

>  I can confirm this worked in 6.0-R and is broken in 6.1-R, and I can 
>  confirm it was the commit by ume at freebsd.org mentioned in the past log
>  entries of this PR that broke it:
>  http://docs.FreeBSD.org/cgi/mid.cgi?200511042026.jA4KQGX9038319
>  
>  In my case, I don't see the backup constantly switching, instead I see 
>  both the master and backup constantly acting as master, but only on the 
>  IPv6 interface - the IPv4 interface works as expected.  This difference 
>  could be due to te fact that I have the IPv4 interface on this machine 
>  also under carp's control, although I do have sysctl 
>  net.inet.carp.preempt=1, which in theory should mean that all interfaces 
>  track each other's state.

Could you please try the attached patch (this is for RELENG_6, but the
same patch would probably work for -CURRENT)?

I can reproduce the phenomena and it seems like my patch fixes it.

Here's my analysis:
 The destination address (ff02::12) of IPv6 CARP packet does not
 contain a scope information.  In such case, IPv6 stack does now allow
 the advertisement of CARP packet, because of an inconsistent scope
 boundary information, which was introduced in the patch you mentioned
 above.  (i.e. the destination address must have a link-local scope,
 but there is no scope information at all)


Index: ip_carp.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.27.2.8
diff -u -p -r1.27.2.8 ip_carp.c
--- ip_carp.c	25 Sep 2006 13:01:59 -0000	1.27.2.8
+++ ip_carp.c	6 Oct 2006 03:52:03 -0000
@@ -968,6 +968,7 @@ carp_send_ad_locked(struct carp_softc *s
 		ip6->ip6_dst.s6_addr8[0] = 0xff;
 		ip6->ip6_dst.s6_addr8[1] = 0x02;
 		ip6->ip6_dst.s6_addr8[15] = 0x12;
+		in6_setscope(&ip6->ip6_dst, sc->sc_ia6->ia_ifp, NULL);
 
 		ch_ptr = (struct carp_header *)(&ip6[1]);
 		bcopy(&ch, ch_ptr, sizeof(ch));


More information about the freebsd-bugs mailing list