From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:18:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B9F106566B; Fri, 25 May 2012 08:18:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CCAD8FC16; Fri, 25 May 2012 08:18:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P8Hxlr090053; Fri, 25 May 2012 08:17:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8Hxl1090051; Fri, 25 May 2012 08:17:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250817.q4P8Hxl1090051@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 08:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235981 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:18:00 -0000 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 #include #include +#include #include #include +#include + #include #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)