Author: bz
Date: Fri May 25 08:17:59 2012
New Revision: 235981
URL: http://svn.freebsd.org/changeset/base/235981

Log:
  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

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==============================================================================
--- head/sys/netinet/tcp_lro.c  Fri May 25 07:57:17 2012        (r235980)
+++ head/sys/netinet/tcp_lro.c  Fri May 25 08:17:59 2012        (r235981)
@@ -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 m
        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 m
 #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)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to