Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 22:43:26 +0100
From:      Bruce Simpson <bms@incunabulum.net>
To:        David Wolfskill <david@catwhisker.org>,  Chagin Dmitry <dchagin@freebsd.org>, Robert Watson <rwatson@freebsd.org>, current@freebsd.org
Subject:   Re: Panic: witness_warn (r191682; shared rw udpinp (udpinp)...netinet6/udp6_usrreq.c:360)
Message-ID:  <49FA1B7E.7060201@incunabulum.net>
In-Reply-To: <20090430213621.GA61978@albert.catwhisker.org>
References:  <20090430155408.GX1387@albert.catwhisker.org>	<alpine.BSF.2.00.0904302026460.8997@fledge.watson.org>	<20090430204828.GA6551@dchagin.static.corbina.ru> <20090430213621.GA61978@albert.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
David Wolfskill wrote:
> ...
> I believe that qualifies as Goodness, as I was able to use ssh to
> access the machine, so it's definitely up in multi-user mode.
>   


Hi,

Can you try this patch? This patch is probably more correct -- but you 
can see my intent was to avoid thrashing the INP lock on mcast delivery. 
INP lock use in that routine is goopy to read. That'll teach me to do 
things from memory for IPv4... bah! :-)


cheers
BMS

[-- Attachment #2 --]
Index: udp6_usrreq.c
===================================================================
--- udp6_usrreq.c	(revision 191705)
+++ udp6_usrreq.c	(working copy)
@@ -279,8 +279,6 @@
 					continue;
 			}
 
-			INP_RLOCK(inp);
-
 			/*
 			 * Handle socket delivery policy for any-source
 			 * and source-specific multicast. [RFC3678]
@@ -290,6 +288,8 @@
 				struct sockaddr_in6	 mcaddr;
 				int			 blocked;
 
+				INP_RLOCK(inp);
+
 				bzero(&mcaddr, sizeof(struct sockaddr_in6));
 				mcaddr.sin6_len = sizeof(struct sockaddr_in6);
 				mcaddr.sin6_family = AF_INET6;
@@ -304,9 +304,11 @@
 					if (blocked == MCAST_NOTSMEMBER ||
 					    blocked == MCAST_MUTED)
 						UDPSTAT_INC(udps_filtermcast);
-					INP_RUNLOCK(inp);
+					INP_RUNLOCK(inp); /* XXX */
 					continue;
 				}
+
+				INP_RUNLOCK(inp);
 			}
 			if (last != NULL) {
 				struct mbuf *n;
@@ -423,8 +425,6 @@
 	return (IPPROTO_DONE);
 
 badheadlocked:
-	if (inp)
-		INP_RUNLOCK(inp);
 	INP_INFO_RUNLOCK(&V_udbinfo);
 badunlocked:
 	if (m)

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49FA1B7E.7060201>