Index: sys/netinet/in.c =================================================================== RCS file: /cvsroot/src/sys/netinet/in.c,v retrieving revision 1.147 diff -p -u -r1.147 in.c --- sys/netinet/in.c 1 Jul 2014 05:49:18 -0000 1.147 +++ sys/netinet/in.c 22 Aug 2014 16:38:57 -0000 @@ -1123,6 +1123,7 @@ in_addmulti(struct in_addr *ap, ifnet_t /* * See if address already in list. */ + mutex_enter(softnet_lock); rw_enter(&in_multilock, RW_WRITER); inm = in_lookup_multi(*ap, ifp); if (inm != NULL) { @@ -1131,6 +1132,7 @@ in_addmulti(struct in_addr *ap, ifnet_t */ inm->inm_refcount++; rw_exit(&in_multilock); + mutex_exit(softnet_lock); return inm; } @@ -1140,6 +1142,7 @@ in_addmulti(struct in_addr *ap, ifnet_t inm = pool_get(&inmulti_pool, PR_NOWAIT); if (inm == NULL) { rw_exit(&in_multilock); + mutex_exit(softnet_lock); return NULL; } inm->inm_addr = *ap; @@ -1153,6 +1156,7 @@ in_addmulti(struct in_addr *ap, ifnet_t sockaddr_in_init(&sin, ap, 0); if (if_mcast_op(ifp, SIOCADDMULTI, sintosa(&sin)) != 0) { rw_exit(&in_multilock); + mutex_exit(softnet_lock); pool_put(&inmulti_pool, inm); return NULL; } @@ -1162,6 +1166,7 @@ in_addmulti(struct in_addr *ap, ifnet_t */ if (igmp_joingroup(inm) != 0) { rw_exit(&in_multilock); + mutex_exit(softnet_lock); pool_put(&inmulti_pool, inm); return NULL; } @@ -1170,6 +1175,7 @@ in_addmulti(struct in_addr *ap, ifnet_t inm, inm_list); in_multientries++; rw_exit(&in_multilock); + mutex_exit(softnet_lock); return inm; } Index: sys/netinet/igmp.c =================================================================== RCS file: /cvsroot/src/sys/netinet/igmp.c,v retrieving revision 1.55 diff -p -u -r1.55 igmp.c --- sys/netinet/igmp.c 29 May 2014 23:02:48 -0000 1.55 +++ sys/netinet/igmp.c 22 Aug 2014 16:38:57 -0000 @@ -469,6 +469,8 @@ igmp_input(struct mbuf *m, ...) int igmp_joingroup(struct in_multi *inm) { + + KASSERT(mutex_owned(softnet_lock)); KASSERT(in_multi_lock_held()); inm->inm_state = IGMP_IDLE_MEMBER; @@ -494,6 +496,8 @@ igmp_joingroup(struct in_multi *inm) void igmp_leavegroup(struct in_multi *inm) { + + KASSERT(mutex_owned(softnet_lock)); KASSERT(in_multi_lock_held()); switch (inm->inm_state) {