diff options
author | Jack F Vogel <jfv@FreeBSD.org> | 2011-01-25 23:23:45 +0000 |
---|---|---|
committer | Jack F Vogel <jfv@FreeBSD.org> | 2011-01-25 23:23:45 +0000 |
commit | f69c23b652ed5d2d46ac21e797ae4f16868b3d54 (patch) | |
tree | 1f35b9be1f2063086672442267f9b62654cbc250 | |
parent | 5c210ab5d58f71e0c90f811674571b355b7d7bd3 (diff) | |
download | src-f69c23b652ed5d2d46ac21e797ae4f16868b3d54.tar.gz src-f69c23b652ed5d2d46ac21e797ae4f16868b3d54.zip |
MFC stable/7 r217724
Fix to kern/152853, misplaced pullup
in em_xmit breaks UDP tx, thanks to
Petr Lampa for the patch.
Approved by: re (bz)
Notes
Notes:
svn path=/releng/7.4/; revision=217866
-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 759a55dc958d..c5e936d55693 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1699,12 +1699,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: @@ -1728,6 +1728,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) { |