Author: ae
Date: Wed Jun 13 07:16:01 2018
New Revision: 335032
URL: https://svnweb.freebsd.org/changeset/base/335032

Log:
  MFC r334707:
    Use m_copyback() function to write delayed checksum when it isn't located
    in the first mbuf of the chain.

Modified:
  stable/11/sys/netinet6/ip6_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/ip6_output.c
==============================================================================
--- stable/11/sys/netinet6/ip6_output.c Wed Jun 13 07:14:34 2018        
(r335031)
+++ stable/11/sys/netinet6/ip6_output.c Wed Jun 13 07:16:01 2018        
(r335032)
@@ -200,18 +200,10 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_sho
                csum = 0xffff;
        offset += m->m_pkthdr.csum_data;        /* checksum offset */
 
-       if (offset + sizeof(u_short) > m->m_len) {
-               printf("%s: delayed m_pullup, m->len: %d plen %u off %u "
-                   "csum_flags=%b\n", __func__, m->m_len, plen, offset,
-                   (int)m->m_pkthdr.csum_flags, CSUM_BITS);
-               /*
-                * XXX this should not happen, but if it does, the correct
-                * behavior may be to insert the checksum in the appropriate
-                * next mbuf in the chain.
-                */
-               return;
-       }
-       *(u_short *)(m->m_data + offset) = csum;
+       if (offset + sizeof(csum) > m->m_len)
+               m_copyback(m, offset, sizeof(csum), (caddr_t)&csum);
+       else
+               *(u_short *)mtodo(m, offset) = csum;
 }
 
 int
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to