Date: Wed, 19 Jan 2011 18:20:11 +0000 (UTC) From: Jack F Vogel <jfv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r217591 - head/sys/dev/e1000 Message-ID: <201101191820.p0JIKBXq084883@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101191820.p0JIKBXq084883>