From: bluhm Date: Fri, 7 Jul 2023 19:45:26 +0000 (+0000) Subject: Keep mbuf header field ph_mss during loopback TCP with LRO/TSO. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=694d9bfd90e25287143f2b021ef2becec67cc4fd;p=openbsd Keep mbuf header field ph_mss during loopback TCP with LRO/TSO. When M_TCP_TSO is preserved, also keep ph_mss. In lo(4) this logic was missing. This may be relevant only for weird pf configs that forward from loopback. OK mvs@ jan@ --- diff --git a/sys/net/if.c b/sys/net/if.c index fd54cc813f3..27570bef2f2 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.705 2023/07/07 08:05:02 bluhm Exp $ */ +/* $OpenBSD: if.c,v 1.706 2023/07/07 19:45:26 bluhm Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -782,6 +782,7 @@ int if_input_local(struct ifnet *ifp, struct mbuf *m, sa_family_t af) { int keepflags, keepcksum; + uint16_t keepmss; #if NBPFILTER > 0 /* @@ -807,9 +808,11 @@ if_input_local(struct ifnet *ifp, struct mbuf *m, sa_family_t af) keepcksum = m->m_pkthdr.csum_flags & (M_IPV4_CSUM_OUT | M_TCP_CSUM_OUT | M_UDP_CSUM_OUT | M_ICMP_CSUM_OUT | M_TCP_TSO); + keepmss = m->m_pkthdr.ph_mss; m_resethdr(m); m->m_flags |= M_LOOP | keepflags; m->m_pkthdr.csum_flags = keepcksum; + m->m_pkthdr.ph_mss = keepmss; m->m_pkthdr.ph_ifidx = ifp->if_index; m->m_pkthdr.ph_rtableid = ifp->if_rdomain;