diff options
-rw-r--r-- | sys/netinet/in_pcb.h | 3 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 3 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index f2388fb..0de251a 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -260,6 +260,9 @@ struct inpcbinfo { /* XXX documentation, prefixes */ mtx_assert(&(ipi)->ipi_mtx, MA_OWNED); \ NET_ASSERT_GIANT(); \ } while (0) +#define INP_INFO_UNLOCK_ASSERT(ipi) do { \ + mtx_assert(&(ipi)->ipi_mtx, MA_NOTOWNED); \ +} while (0) #define INP_PCBHASH(faddr, lport, fport, mask) \ (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 326241f..b8fc45f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -997,13 +997,16 @@ findpcb: return; dropwithreset: + INP_INFO_WLOCK_ASSERT(&tcbinfo); tcp_dropwithreset(m, th, tp, tlen, rstreason); m = NULL; /* mbuf chain got consumed. */ dropunlock: + INP_INFO_WLOCK_ASSERT(&tcbinfo); if (tp != NULL) INP_UNLOCK(inp); INP_INFO_WUNLOCK(&tcbinfo); drop: + INP_INFO_UNLOCK_ASSERT(&tcbinfo); if (m != NULL) m_freem(m); return; diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 326241f..b8fc45f 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -997,13 +997,16 @@ findpcb: return; dropwithreset: + INP_INFO_WLOCK_ASSERT(&tcbinfo); tcp_dropwithreset(m, th, tp, tlen, rstreason); m = NULL; /* mbuf chain got consumed. */ dropunlock: + INP_INFO_WLOCK_ASSERT(&tcbinfo); if (tp != NULL) INP_UNLOCK(inp); INP_INFO_WUNLOCK(&tcbinfo); drop: + INP_INFO_UNLOCK_ASSERT(&tcbinfo); if (m != NULL) m_freem(m); return; |