summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2008-09-29 15:19:37 +0000
committerRobert Watson <rwatson@FreeBSD.org>2008-09-29 15:19:37 +0000
commit066dd375a1c322139662cd561be9b85532188b92 (patch)
treebf15ee1aecaa004e03c47574d300b3ab69c5e9ba
parent99ac0de72f905adada4a842d5162aefb9427c068 (diff)
Notes
-rw-r--r--sys/netinet/tcp_input.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 18f0027221bc6..201241364afb0 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -2400,12 +2400,19 @@ dropafterack:
dropwithreset:
KASSERT(headlocked, ("%s: dropwithreset: head not locked", __func__));
- tcp_dropwithreset(m, th, tp, tlen, rstreason);
-
- if (tp != NULL)
+ /*
+ * If tp is non-NULL, we call tcp_dropwithreset() holding both inpcb
+ * and global locks. However, if NULL, we must hold neither as
+ * firewalls may acquire the global lock in order to look for a
+ * matching inpcb.
+ */
+ if (tp != NULL) {
+ tcp_dropwithreset(m, th, tp, tlen, rstreason);
INP_WUNLOCK(tp->t_inpcb);
- if (headlocked)
- INP_INFO_WUNLOCK(&tcbinfo);
+ }
+ INP_INFO_WUNLOCK(&tcbinfo);
+ if (tp == NULL)
+ tcp_dropwithreset(m, th, NULL, tlen, rstreason);
return;
drop: