Add INP_INFO_UNLOCK_ASSERT() and use it in tcp_input(). Also add some
further INP_INFO_WLOCK_ASSERT() while there.
This commit is contained in:
parent
0c38fd0a7a
commit
995a77176f
@ -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))
|
||||
|
@ -997,13 +997,16 @@ tcp_input(struct mbuf *m, int off0)
|
||||
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;
|
||||
|
@ -997,13 +997,16 @@ tcp_input(struct mbuf *m, int off0)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user