Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

IPv6 init order and RPI



Hi all,
while trying to update my first generation RPI, I hit a kernel panic
during first boot. Looking a bit further, for unknown reasons the
address setup sometimes fails with usmsc. When it does, the ip6_input
case can trigger the timeout handling on the incompletely set up
address. The attached patch seems to fix that problem at least.
Comments?

Joerg
Index: mld6.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/mld6.c,v
retrieving revision 1.59.2.2
diff -u -p -r1.59.2.2 mld6.c
--- mld6.c	23 Jan 2015 09:27:15 -0000	1.59.2.2
+++ mld6.c	8 Nov 2015 18:30:43 -0000
@@ -656,8 +656,12 @@ in6_addmulti(struct in6_addr *maddr6, st
 		in6m->in6m_ifp = ifp;
 		in6m->in6m_refcount = 1;
 		in6m->in6m_timer = IN6M_TIMER_UNDEF;
+		callout_init(&in6m->in6m_timer_ch, CALLOUT_MPSAFE);
+		callout_setfunc(&in6m->in6m_timer_ch, mld_timeo, in6m);
+
 		IFP_TO_IA6(ifp, ia);
 		if (ia == NULL) {
+			callout_destroy(&in6m->in6m_timer_ch);
 			free(in6m, M_IPMADDR);
 			splx(s);
 			*errorp = EADDRNOTAVAIL; /* appropriate? */
@@ -674,6 +678,7 @@ in6_addmulti(struct in6_addr *maddr6, st
 		sockaddr_in6_init(&sin6, maddr6, 0, 0, 0);
 		*errorp = if_mcast_op(ifp, SIOCADDMULTI, sin6tosa(&sin6));
 		if (*errorp) {
+			callout_destroy(&in6m->in6m_timer_ch);
 			LIST_REMOVE(in6m, in6m_entry);
 			free(in6m, M_IPMADDR);
 			IFAFREE(&ia->ia_ifa);
@@ -681,8 +686,6 @@ in6_addmulti(struct in6_addr *maddr6, st
 			return (NULL);
 		}
 
-		callout_init(&in6m->in6m_timer_ch, CALLOUT_MPSAFE);
-		callout_setfunc(&in6m->in6m_timer_ch, mld_timeo, in6m);
 		in6m->in6m_timer = timer;
 		if (in6m->in6m_timer > 0) {
 			in6m->in6m_state = MLD_REPORTPENDING;


Home | Main Index | Thread Index | Old Index