diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2024-12-31 16:22:03 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2024-12-31 16:22:03 +0000 |
commit | 4940584bbf0b809130f6ac1a7a0c6b00d373af1e (patch) | |
tree | aa8e2caa9bd1358953cfbf6a829524366cafe760 | |
parent | 81f9d3b11f310b28e4bf8cc2ad2d84e4aadd929d (diff) |
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
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D48258
-rw-r--r-- | sys/netinet/tcp_stacks/rack_bbr_common.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 156091feeb30..da26b8cb1f9b 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -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); } |