aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack F Vogel <jfv@FreeBSD.org>2011-01-25 23:23:45 +0000
committerJack F Vogel <jfv@FreeBSD.org>2011-01-25 23:23:45 +0000
commitf69c23b652ed5d2d46ac21e797ae4f16868b3d54 (patch)
tree1f35b9be1f2063086672442267f9b62654cbc250
parent5c210ab5d58f71e0c90f811674571b355b7d7bd3 (diff)
downloadsrc-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.c15
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) {