diff options
author | jfv <jfv@FreeBSD.org> | 2011-01-19 18:20:11 +0000 |
---|---|---|
committer | jfv <jfv@FreeBSD.org> | 2011-01-19 18:20:11 +0000 |
commit | 1c40bff239fb1e662e509cecf113c7516facb916 (patch) | |
tree | a6cc8850154c1c66b8d4c2f77ce3f1c38c98073f /sys/dev/e1000 | |
parent | 7276c51686b8ff6b7a9e98912a6069cfae320a70 (diff) | |
download | FreeBSD-src-1c40bff239fb1e662e509cecf113c7516facb916.zip FreeBSD-src-1c40bff239fb1e662e509cecf113c7516facb916.tar.gz |
Fix for kern/152853, pullup at the wrong point
is breaking UDP. Thanks to Petr Lampa for the
patch.
Diffstat (limited to 'sys/dev/e1000')
-rw-r--r-- | sys/dev/e1000/if_em.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index f2e5257..6508ae2 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1820,12 +1820,12 @@ em_xmit(struct tx_ring *txr, struct mbuf **m_headp) } 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 **m_headp) 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) { |