PERFORCE change 40125 for review
Sam Leffler
sam at FreeBSD.org
Tue Oct 21 15:19:30 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=40125
Change 40125 by sam at sam_ebb on 2003/10/21 15:19:09
apply bandaid to locking problem in divert sockets
Affected files ...
.. //depot/projects/netperf/sys/netinet/ip_divert.c#6 edit
Differences ...
==== //depot/projects/netperf/sys/netinet/ip_divert.c#6 (text+ko) ====
@@ -219,6 +219,20 @@
m->m_pkthdr.rcvif->if_unit);
}
+ /*
+ * XXX sbappendaddr must be protected by Giant until
+ * we have locking at the socket layer. When entered
+ * from below we come in w/o Giant and must take it
+ * here. Unfortunately we cannot tell whether we're
+ * entering from above (already holding Giant),
+ * below (potentially without Giant), or otherwise
+ * (e.g. from tcp_syncache through a timeout) so we
+ * have to grab it regardless. This causes a LOR with
+ * the tcp lock, at least, and possibly others. For
+ * the moment we're ignoring this. Once sockets are
+ * locked this cruft can be removed.
+ */
+ mtx_lock(&Giant); /* XXX */
/* Put packet on socket queue, if any */
sa = NULL;
nport = htons((u_int16_t)port);
@@ -240,6 +254,7 @@
INP_UNLOCK(inp);
}
INP_INFO_RUNLOCK(&divcbinfo);
+ mtx_unlock(&Giant); /* XXX */
if (sa == NULL) {
m_freem(m);
ipstat.ips_noproto++;
More information about the p4-projects
mailing list