From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 18:20:11 2011 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 C5E0D106564A; Wed, 19 Jan 2011 18:20:11 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56018FC1C; Wed, 19 Jan 2011 18:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JIKBUn084885; Wed, 19 Jan 2011 18:20:11 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JIKBXq084883; Wed, 19 Jan 2011 18:20:11 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101191820.p0JIKBXq084883@svn.freebsd.org> From: Jack F Vogel Date: Wed, 19 Jan 2011 18:20:11 +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: r217591 - head/sys/dev/e1000 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: Wed, 19 Jan 2011 18:20:11 -0000 Author: jfv Date: Wed Jan 19 18:20:11 2011 New Revision: 217591 URL: http://svn.freebsd.org/changeset/base/217591 Log: Fix for kern/152853, pullup at the wrong point is breaking UDP. Thanks to Petr Lampa for the patch. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 19 17:40:58 2011 (r217590) +++ head/sys/dev/e1000/if_em.c Wed Jan 19 18:20:11 2011 (r217591) @@ -1820,12 +1820,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1849,6 +1849,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) {