mirror of
https://github.com/opnsense/src.git
synced 2026-02-19 02:30:08 -05:00
TCP RACK, BBR: cleanup of ctf_process_inbound_raw()
Instead of dealing with ifp == NULL, which should never happen, assume that this is not true. Use KASSERT to make this clear. No functional change intended. Reviewed by: glebius, rrs CID: 1523767 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48258 (cherry picked from commit 4940584bbf0b809130f6ac1a7a0c6b00d373af1e)
This commit is contained in:
parent
0da0b392e2
commit
dd0d5ece19
1 changed files with 7 additions and 22 deletions
|
|
@ -361,26 +361,15 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct mbuf *m, int has_pkt)
|
|||
int32_t retval, nxt_pkt, tlen, off;
|
||||
int etype = 0;
|
||||
uint16_t drop_hdrlen;
|
||||
uint8_t iptos, no_vn=0;
|
||||
uint8_t iptos;
|
||||
|
||||
inp = tptoinpcb(tp);
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
NET_EPOCH_ASSERT();
|
||||
|
||||
if (m)
|
||||
ifp = m_rcvif(m);
|
||||
else
|
||||
ifp = NULL;
|
||||
if (ifp == NULL) {
|
||||
/*
|
||||
* We probably should not work around
|
||||
* but kassert, since lro alwasy sets rcvif.
|
||||
*/
|
||||
no_vn = 1;
|
||||
goto skip_vnet;
|
||||
}
|
||||
KASSERT(m != NULL, ("ctf_process_inbound_raw: m == NULL"));
|
||||
ifp = m_rcvif(m);
|
||||
KASSERT(ifp != NULL, ("ctf_process_inbound_raw: ifp == NULL"));
|
||||
CURVNET_SET(ifp->if_vnet);
|
||||
skip_vnet:
|
||||
tcp_get_usecs(&tv);
|
||||
while (m) {
|
||||
m_save = m->m_nextpkt;
|
||||
|
|
@ -466,18 +455,14 @@ skip_vnet:
|
|||
m_freem(m);
|
||||
m = m_save;
|
||||
}
|
||||
if (no_vn == 0) {
|
||||
CURVNET_RESTORE();
|
||||
}
|
||||
CURVNET_RESTORE();
|
||||
INP_UNLOCK_ASSERT(inp);
|
||||
return(retval);
|
||||
return (retval);
|
||||
}
|
||||
skipped_pkt:
|
||||
m = m_save;
|
||||
}
|
||||
if (no_vn == 0) {
|
||||
CURVNET_RESTORE();
|
||||
}
|
||||
CURVNET_RESTORE();
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue