Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

0 views
Skip to first unread message

Gavin Atkinson

unread,
Jul 27, 2006, 12:12:36 PM7/27/06
to
The following reply was made to PR kern/98622; it has been noted by GNATS.

From: Gavin Atkinson <gavin.a...@ury.york.ac.uk>
To: bug-fo...@FreeBSD.org, Philipp...@crc.u-strasbg.fr
Cc: u...@FreeBSD.org
Subject: Re: kern/98622: [carp] carp with IPv6 broken on 6.1 (regression)
Date: Thu, 27 Jul 2006 17:03:40 +0100 (BST)

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 u...@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.

Gavin
_______________________________________________
freebs...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs...@freebsd.org"

Hajimu UMEMOTO

unread,
Jul 27, 2006, 12:54:42 PM7/27/06
to
The following reply was made to PR kern/98622; it has been noted by GNATS.

From: Hajimu UMEMOTO <u...@FreeBSD.org>
To: Gavin Atkinson <gavin.a...@ury.york.ac.uk>
Cc: bug-fo...@FreeBSD.org, Philipp...@crc.u-strasbg.fr, u...@FreeBSD.org
Subject: Re: kern/98622: [carp] carp with IPv6 broken on 6.1 (regression)

Date: Fri, 28 Jul 2006 01:46:04 +0900

Hi,

>>>>> On Thu, 27 Jul 2006 17:03:40 +0100 (BST)
>>>>> Gavin Atkinson <gavin.a...@ury.york.ac.uk> said:


gavin.atkinson> I can confirm this worked in 6.0-R and is broken in 6.1-R, and I can
gavin.atkinson> confirm it was the commit by u...@freebsd.org mentioned in the past log
gavin.atkinson> entries of this PR that broke it:
gavin.atkinson> http://docs.FreeBSD.org/cgi/mid.cgi?200511042026.jA4KQGX9038319

ipcarp.c:1.27.2.3 changed to just use the scope API rather than hard
coded scope things, and itself seems correct. However, it might
change some semantics.
I don't have an environment for testing CARP. Please backout 1.27.2.3
by applying the following patch, and let me the result.

Index: sys/netinet/ip_carp.c
diff -u -p sys/netinet/ip_carp.c.orig sys/netinet/ip_carp.c
--- sys/netinet/ip_carp.c.orig Mon Dec 26 06:59:20 2005
+++ sys/netinet/ip_carp.c Mon Jul 10 16:50:22 2006
@@ -269,7 +269,8 @@ carp_hmac_prepare(struct carp_softc *sc)
TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family == AF_INET6) {
in6 = ifatoia6(ifa)->ia_addr.sin6_addr;
- in6_clearscope(&in6);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6))
+ in6.s6_addr16[1] = 0;
SHA1Update(&sc->sc_sha1, (void *)&in6, sizeof(in6));
}
}
@@ -1543,7 +1544,7 @@ carp_set_addr6(struct carp_softc *sc, st
struct in6_ifaddr *ia, *ia_if;
struct ip6_moptions *im6o = &sc->sc_im6o;
struct in6_multi_mship *imm;
- struct in6_addr in6;
+ struct sockaddr_in6 addr;
int own, error;

if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
@@ -1592,25 +1593,25 @@ carp_set_addr6(struct carp_softc *sc, st
im6o->im6o_multicast_ifp = ifp;

/* join CARP multicast address */
- bzero(&in6, sizeof(in6));
- in6.s6_addr16[0] = htons(0xff02);
- in6.s6_addr8[15] = 0x12;
- if (in6_setscope(&in6, ifp, NULL) != 0)
- goto cleanup;
- if ((imm = in6_joingroup(ifp, &in6, &error, 0)) == NULL)
+ bzero(&addr, sizeof(addr));
+ addr.sin6_family = AF_INET6;
+ addr.sin6_len = sizeof(addr);
+ addr.sin6_addr.s6_addr16[0] = htons(0xff02);
+ addr.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
+ addr.sin6_addr.s6_addr8[15] = 0x12;
+ if ((imm = in6_joingroup(ifp, &addr.sin6_addr, &error, 0)) == NULL)
goto cleanup;
LIST_INSERT_HEAD(&im6o->im6o_memberships, imm, i6mm_chain);

/* join solicited multicast address */
- bzero(&in6, sizeof(in6));
- in6.s6_addr16[0] = htons(0xff02);
- in6.s6_addr32[1] = 0;
- in6.s6_addr32[2] = htonl(1);
- in6.s6_addr32[3] = sin6->sin6_addr.s6_addr32[3];
- in6.s6_addr8[12] = 0xff;
- if (in6_setscope(&in6, ifp, NULL) != 0)
- goto cleanup;
- if ((imm = in6_joingroup(ifp, &in6, &error, 0)) == NULL)
+ bzero(&addr.sin6_addr, sizeof(addr.sin6_addr));
+ addr.sin6_addr.s6_addr16[0] = htons(0xff02);
+ addr.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
+ addr.sin6_addr.s6_addr32[1] = 0;
+ addr.sin6_addr.s6_addr32[2] = htonl(1);
+ addr.sin6_addr.s6_addr32[3] = sin6->sin6_addr.s6_addr32[3];
+ addr.sin6_addr.s6_addr8[12] = 0xff;
+ if ((imm = in6_joingroup(ifp, &addr.sin6_addr, &error, 0)) == NULL)
goto cleanup;
LIST_INSERT_HEAD(&im6o->im6o_memberships, imm, i6mm_chain);
}

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

Gavin Atkinson

unread,
Jul 27, 2006, 1:57:43 PM7/27/06
to
The following reply was made to PR kern/98622; it has been noted by GNATS.

From: Gavin Atkinson <gavin.a...@ury.york.ac.uk>
To: Hajimu UMEMOTO <u...@FreeBSD.org>
Cc: bug-fo...@FreeBSD.org, Philipp...@crc.u-strasbg.fr
Subject: Re: kern/98622: [carp] carp with IPv6 broken on 6.1 (regression)

Date: Thu, 27 Jul 2006 18:46:06 +0100 (BST)

On Fri, 28 Jul 2006, Hajimu UMEMOTO wrote:

> ipcarp.c:1.27.2.3 changed to just use the scope API rather than hard
> coded scope things, and itself seems correct. However, it might
> change some semantics.
> I don't have an environment for testing CARP. Please backout 1.27.2.3
> by applying the following patch, and let me the result.

[patch deleted]

Backing just that part of the larger commit out (and changing it so it
compiled - in6_joingroup only takes three arguments) made no difference to
the problems seen.

I'm happy to test any other patches or add printf's to any bits of code
you would like me to try, but please be aware that I will only be online
occassionally over the next three days.

Gavin

0 new messages