Date: Tue, 25 Feb 2020 15:03:41 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358311 - head/sys/netinet6 Message-ID: <202002251503.01PF3fw2043655@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Tue Feb 25 15:03:41 2020 New Revision: 358311 URL: https://svnweb.freebsd.org/changeset/base/358311 Log: ip6_output: fix regression introduced in r358167 for ipv6 fragmentation When moving the calculations for the optlen into the if (opt) block which deals with possible extension headers I failed to initialise unfragpartlen to the ipv6 header length if there were no extension headers present. Correct that mistake to make IPv6 fragment length calculcations work again. Reported by: hselasky, kp OKed by: hselasky, kp MFC after: 3 days X-MFC with: r358167 PR: 244393 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue Feb 25 12:56:06 2020 (r358310) +++ head/sys/netinet6/ip6_output.c Tue Feb 25 15:03:41 2020 (r358311) @@ -497,7 +497,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, */ bzero(&exthdrs, sizeof(exthdrs)); optlen = 0; - unfragpartlen = 0; + unfragpartlen = sizeof(struct ip6_hdr); if (opt) { /* Hop-by-Hop options header. */ MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh, optlen); @@ -535,7 +535,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, /* Routing header. */ MAKE_EXTHDR(opt->ip6po_rthdr, &exthdrs.ip6e_rthdr, optlen); - unfragpartlen = optlen + sizeof(struct ip6_hdr); + unfragpartlen += optlen; /* * NOTE: we don't add AH/ESP length here (done in
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002251503.01PF3fw2043655>