diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-07-07 08:05:03 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-07-07 08:05:03 +0000 |
commit | 4e63d8b3cde6e705e5e4b66eb328b4a90d8ba9fc (patch) | |
tree | 850ef641cc2a31f88111e137666a9db25e601cd0 /sys/netinet6/ip6_forward.c | |
parent | 297f5bc005a553756076e78fcc76bb5c435d9a62 (diff) |
Fix path MTU discovery for TCP LRO/TSO when forwarding.
When doing LRO (Large Receive Offload), the drivers, currently ix(4)
and lo(4) only, record an upper bound of the size of the original
packets in ph_mss. When sending, either stack or hardware must
chop the packets with TSO (TCP Segmentation Offload) to that size.
That means we have to call tcp_if_output_tso() before ifp->if_output().
Put that logic into if_output_tso() to avoid code duplication. As
TCP packets on the wire do not get larger that way, path MTU discovery
should still work.
tested by and OK jan@
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r-- | sys/netinet6/ip6_forward.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index db68b32eca8..7de1e0ec701 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.111 2023/06/16 19:18:56 bluhm Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.112 2023/07/07 08:05:02 bluhm Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -319,8 +319,7 @@ reroute: } #endif - error = tcp_if_output_tso(ifp, &m, sin6tosa(sin6), rt, IFCAP_TSOv6, - ifp->if_mtu); + error = if_output_tso(ifp, &m, sin6tosa(sin6), rt, ifp->if_mtu); if (error) ip6stat_inc(ip6s_cantforward); else if (m == NULL) @@ -328,17 +327,6 @@ reroute: if (error || m == NULL) goto senderr; - /* Check the size after pf_test to give pf a chance to refragment. */ - if (m->m_pkthdr.len <= ifp->if_mtu) { - in6_proto_cksum_out(m, ifp); - error = ifp->if_output(ifp, m, sin6tosa(sin6), rt); - if (error) - ip6stat_inc(ip6s_cantforward); - else - ip6stat_inc(ip6s_forward); - goto senderr; - } - if (mcopy != NULL) icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu); m_freem(m); |