Date: Wed, 13 Jun 2018 07:16:01 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335032 - stable/11/sys/netinet6 Message-ID: <201806130716.w5D7G1Lj043375@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806130716.w5D7G1Lj043375>