diff options
author | bz <bz@FreeBSD.org> | 2012-05-25 08:17:59 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2012-05-25 08:17:59 +0000 |
commit | 21e6fea08a9e15f9158aebd3cba9c91c801057db (patch) | |
tree | 89486e756f8205e51c5c3d0b7097a8c26c992d16 /sys/netinet | |
parent | c6d017514ef1fb2ef61823af78216702fbef2124 (diff) | |
download | FreeBSD-src-21e6fea08a9e15f9158aebd3cba9c91c801057db.zip FreeBSD-src-21e6fea08a9e15f9158aebd3cba9c91c801057db.tar.gz |
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
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_lro.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 <netinet/in.h> #include <netinet/ip6.h> #include <netinet/ip.h> +#include <netinet/ip_var.h> #include <netinet/tcp.h> #include <netinet/tcp_lro.h> +#include <netinet6/ip6_var.h> + #include <machine/in_cksum.h> #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) |