diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2008-09-25 17:26:54 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2008-09-25 17:26:54 +0000 |
commit | 014ea782b136ec116bebe494e8637dee6a3788f7 (patch) | |
tree | 1caf2bf05f7647466396bf179ae63be90d554fd4 /sys/netinet/tcp_input.c | |
parent | 4ea219803ecb287d31121fef2f151595f07e798c (diff) | |
download | src-014ea782b136ec116bebe494e8637dee6a3788f7.tar.gz src-014ea782b136ec116bebe494e8637dee6a3788f7.zip |
Notes
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ab18c6038cab..78ea22f19952 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -885,13 +885,29 @@ findpcb: dropwithreset: INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - tcp_dropwithreset(m, th, tp, tlen, rstreason); + + /* + * If inp 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 (inp != NULL) { + tcp_dropwithreset(m, th, tp, tlen, rstreason); + INP_WUNLOCK(inp); + } + INP_INFO_WUNLOCK(&V_tcbinfo); + if (inp == NULL) + tcp_dropwithreset(m, th, NULL, tlen, rstreason); m = NULL; /* mbuf chain got consumed. */ + goto drop; + dropunlock: INP_INFO_WLOCK_ASSERT(&V_tcbinfo); if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); + drop: INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); if (s != NULL) |