diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2008-09-29 15:19:37 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2008-09-29 15:19:37 +0000 |
| commit | 066dd375a1c322139662cd561be9b85532188b92 (patch) | |
| tree | bf15ee1aecaa004e03c47574d300b3ab69c5e9ba | |
| parent | 99ac0de72f905adada4a842d5162aefb9427c068 (diff) | |
Notes
| -rw-r--r-- | sys/netinet/tcp_input.c | 17 |
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: |
