From owner-svn-src-head@FreeBSD.ORG Fri Feb 1 07:26:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1BECAEA8; Fri, 1 Feb 2013 07:26:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EBA82F8C; Fri, 1 Feb 2013 07:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117QPSH014239; Fri, 1 Feb 2013 07:26:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117QPgs014238; Fri, 1 Feb 2013 07:26:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302010726.r117QPgs014238@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 1 Feb 2013 07:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246196 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:26:26 -0000 Author: hselasky Date: Fri Feb 1 07:26:25 2013 New Revision: 246196 URL: http://svnweb.freebsd.org/changeset/base/246196 Log: Fix for hardware checksum offloading in SMSC driver. This also fixes IPv6 support for this particular hardware. Submitted by: Daisuke Aoyama Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Fri Feb 1 07:19:19 2013 (r246195) +++ head/sys/dev/usb/net/if_smsc.c Fri Feb 1 07:26:25 2013 (r246196) @@ -1009,6 +1009,10 @@ smsc_bulk_read_callback(struct usb_xfer /* Check if RX TCP/UDP checksumming is being offloaded */ if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { + + struct ether_header *eh; + + eh = mtod(m, struct ether_header *); /* Remove the extra 2 bytes of the csum */ pktlen -= 2; @@ -1020,8 +1024,10 @@ smsc_bulk_read_callback(struct usb_xfer * the padding bytes as well. Therefore to be safe we * ignore the H/W csum on frames less than or equal to * 64 bytes. + * + * Ignore H/W csum for non-IPv4 packets. */ - if (pktlen > ETHER_MIN_LEN) { + if (be16toh(eh->ether_type) == ETHERTYPE_IP && pktlen > ETHER_MIN_LEN) { /* Indicate the UDP/TCP csum has been calculated */ m->m_pkthdr.csum_flags |= CSUM_DATA_VALID;