From 21e6fea08a9e15f9158aebd3cba9c91c801057db Mon Sep 17 00:00:00 2001 From: bz Date: Fri, 25 May 2012 08:17:59 +0000 Subject: In case forwarding is turned on for a given address family, refuse to queue the packet for LRO and tell the driver to directly pass it on. This avoids re-assembly and later re-fragmentation problems when forwarding. It's not the best solution but the simplest and most effective for the moment. Should have been done: ages ago Discussed with and by: many MFC after: 3 days --- sys/netinet/tcp_lro.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index e4c36ad..cd7d282 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -51,9 +51,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include + #include #ifndef LRO_ENTRIES @@ -369,6 +372,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) switch (eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: + if (V_ip6_forwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + return (TCP_LRO_CANNOT); + } l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); error = tcp_lro_rx_ipv6(lc, m, ip6, &th); if (error != 0) @@ -379,6 +386,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) #endif #ifdef INET case ETHERTYPE_IP: + if (V_ipforwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + return (TCP_LRO_CANNOT); + } l3hdr = ip4 = (struct ip *)(eh + 1); error = tcp_lro_rx_ipv4(lc, m, ip4, &th); if (error != 0) -- cgit v1.1