PERFORCE change 81407 for review
Robert Watson
rwatson at FreeBSD.org
Wed Aug 3 16:48:35 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=81407
Change 81407 by rwatson at rwatson_zoo on 2005/08/03 16:48:09
Mark in_multi_mtx as recursible instead of if_addr_mtx, that's
what I meant to do before. This is necessary because IGMP calls
into ip_output() to send out packets while holding the
in_multi_mtx, but ip_output() has to acquire it to perform
address checks. Really, this suggests IGMP shouldn't reenter
the network code quite as much as it does.
Affected files ...
.. //depot/projects/netsmp/src/sys/net/if_var.h#8 edit
.. //depot/projects/netsmp/src/sys/netinet/in.c#5 edit
Differences ...
==== //depot/projects/netsmp/src/sys/net/if_var.h#8 (text+ko) ====
@@ -221,7 +221,7 @@
* Locks for address lists on the network interface.
*/
#define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \
- "if_addr_mtx", NULL, MTX_DEF | MTX_RECURSE)
+ "if_addr_mtx", NULL, MTX_DEF)
#define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx)
#define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx)
#define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx)
==== //depot/projects/netsmp/src/sys/netinet/in.c#5 (text+ko) ====
@@ -69,13 +69,15 @@
&subnetsarelocal, 0, "Treat all subnets as directly connected");
/*
- * The IPv4 multicast list (in_multihead and associated structures)
- * are protected by the global in_multi_mtx. See in_var.h for
- * more details.
+ * The IPv4 multicast list (in_multihead and associated structures) are
+ * protected by the global in_multi_mtx. See in_var.h for more details. For
+ * now, in_multi_mtx is marked as recursible due to IGMP's calling back into
+ * ip_output() to send IGMP packets while holding the lock; this probably is
+ * not quite desirable.
*/
struct in_multihead in_multihead; /* XXX BSS initialization */
struct mtx in_multi_mtx;
-MTX_SYSINIT(in_multi_mtx, &in_multi_mtx, "in_multi_mtx", MTX_DEF);
+MTX_SYSINIT(in_multi_mtx, &in_multi_mtx, "in_multi_mtx", MTX_DEF | MTX_RECURSE);
extern struct inpcbinfo ripcbinfo;
extern struct inpcbinfo udbinfo;
More information about the p4-projects
mailing list