Removing NET_NEEDS_GIANT: first patch
Robert Watson
rwatson at FreeBSD.org
Fri Jul 27 14:28:47 UTC 2007
On Wed, 25 Jul 2007, Robert Watson wrote:
> Things this patch doesn't do:
>
> - Address the WITNESS lock order warnings generated when credential rules
> are
> used with ipfw/pf. These are believed to be annoying but non-harmful, as
> deadlocks are no longer reported. This view may be revised if evidence to
> the contrary is presented.
Kris managed to find a report that one of the post-6.0 hangs involved DIVERT
sockets, and sure enough, there is a call to ip_output() without an inpcb
pointer, which could cause problems. The attached patch may fix this and
another recursion-ish issue involving directly invoking ip_input() rather than
indirectly via the netisr. If users of IPDIVERT could give this patch a try
and make sure breaks, it could be this resolves the reported issues.
Regardless of whether it fixes things, it should probably be committed anyway.
Robert N M Watson
Computer Laboratory
University of Cambridge
Index: ip_divert.c
===================================================================
RCS file: /data/fbsd-cvs/ncvs/src/sys/netinet/ip_divert.c,v
retrieving revision 1.128
diff -u -r1.128 ip_divert.c
--- ip_divert.c 11 May 2007 10:20:50 -0000 1.128
+++ ip_divert.c 27 Jul 2007 14:25:09 -0000
@@ -61,6 +61,7 @@
#include <vm/uma.h>
#include <net/if.h>
+#include <net/netisr.h>
#include <net/route.h>
#include <netinet/in.h>
@@ -378,7 +379,7 @@
((so->so_options & SO_DONTROUTE) ?
IP_ROUTETOIF : 0) |
IP_ALLOWBROADCAST | IP_RAWOUTPUT,
- inp->inp_moptions, NULL);
+ inp->inp_moptions, inp);
}
INP_UNLOCK(inp);
INP_INFO_WUNLOCK(&divcbinfo);
@@ -407,7 +408,7 @@
SOCK_UNLOCK(so);
#endif
/* Send packet to input processing */
- ip_input(m);
+ netisr_queue(NETISR_IP, m);
}
return error;
More information about the freebsd-current
mailing list