tcp_usr_rcvd: don't cast inp_ppcb to tcpcb before checking inp_flags

Fixes:	f64dc2ab5b
This commit is contained in:
Gleb Smirnoff 2021-12-27 10:41:51 -08:00
parent 03f9cc89e1
commit 37a7f55737

View File

@ -934,12 +934,12 @@ tcp_usr_rcvd(struct socket *so, int flags)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL"));
INP_WLOCK(inp);
NET_EPOCH_ENTER(et);
tp = intotcpcb(inp);
if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
error = ECONNRESET;
goto out;
INP_WUNLOCK(inp);
return (ECONNRESET);
}
tp = intotcpcb(inp);
NET_EPOCH_ENTER(et);
TCPDEBUG1();
/*
* For passively-created TFO connections, don't attempt a window