Index: in6_ifattach.c =================================================================== RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/netinet6/in6_ifattach.c,v retrieving revision 1.31 diff -u -r1.31 in6_ifattach.c --- in6_ifattach.c 21 Oct 2005 16:23:00 -0000 1.31 +++ in6_ifattach.c 23 Apr 2006 14:33:01 -0000 @@ -794,10 +794,8 @@ /* leave from all multicast groups joined */ - if (udbinfo.listhead != NULL) - in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp); - if (ripcbinfo.listhead != NULL) - in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp); + in6_pcbpurgeif0(&udbinfo, ifp); + in6_pcbpurgeif0(&ripcbinfo, ifp); for (in6m = LIST_FIRST(&in6_multihead); in6m; in6m = in6m_next) { in6m_next = LIST_NEXT(in6m, in6m_entry); Index: in6_pcb.c =================================================================== RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/netinet6/in6_pcb.c,v retrieving revision 1.68 diff -u -r1.68 in6_pcb.c --- in6_pcb.c 15 Apr 2006 05:24:23 -0000 1.68 +++ in6_pcb.c 23 Apr 2006 14:53:57 -0000 @@ -799,15 +799,17 @@ } void -in6_pcbpurgeif0(head, ifp) - struct in6pcb *head; +in6_pcbpurgeif0(pcbinfo, ifp) + struct inpcbinfo *pcbinfo; struct ifnet *ifp; { struct in6pcb *in6p; struct ip6_moptions *im6o; struct in6_multi_mship *imm, *nimm; - for (in6p = head; in6p != NULL; in6p = LIST_NEXT(in6p, inp_list)) { + INP_INFO_RLOCK(pcbinfo); + LIST_FOREACH(in6p, pcbinfo->listhead, inp_list) { + INP_LOCK(in6p); im6o = in6p->in6p_moptions; if ((in6p->inp_vflag & INP_IPV6) && im6o) { @@ -834,7 +836,9 @@ } } } + INP_UNLOCK(in6p); } + INP_INFO_RUNLOCK(pcbinfo); } /* Index: in6_pcb.h =================================================================== RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/netinet6/in6_pcb.h,v retrieving revision 1.17 diff -u -r1.17 in6_pcb.h --- in6_pcb.h 1 Apr 2006 16:04:42 -0000 1.17 +++ in6_pcb.h 23 Apr 2006 14:33:01 -0000 @@ -70,7 +70,7 @@ #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) -void in6_pcbpurgeif0 __P((struct in6pcb *, struct ifnet *)); +void in6_pcbpurgeif0 __P((struct inpcbinfo *, struct ifnet *)); void in6_losing __P((struct inpcb *)); int in6_pcbbind __P((struct inpcb *, struct sockaddr *, struct ucred *)); int in6_pcbconnect __P((struct inpcb *, struct sockaddr *, struct ucred *));