Author: jfv
Date: Tue Jan 25 23:23:45 2011
New Revision: 217866
URL: http://svn.freebsd.org/changeset/base/217866

Log:
  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)

Modified:
  releng/7.4/sys/dev/e1000/if_em.c
Directory Properties:
  releng/7.4/sys/   (props changed)
  releng/7.4/sys/cddl/contrib/opensolaris/   (props changed)
  releng/7.4/sys/contrib/dev/acpica/   (props changed)
  releng/7.4/sys/contrib/pf/   (props changed)

Modified: releng/7.4/sys/dev/e1000/if_em.c
==============================================================================
--- releng/7.4/sys/dev/e1000/if_em.c    Tue Jan 25 23:20:22 2011        
(r217865)
+++ releng/7.4/sys/dev/e1000/if_em.c    Tue Jan 25 23:23:45 2011        
(r217866)
@@ -1699,12 +1699,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:
@@ -1728,6 +1728,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) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to