From owner-svn-src-all@freebsd.org Tue Feb 25 12:44:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BAD825B089; Tue, 25 Feb 2020 12:44:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Rdsx2qmJz4BcJ; Tue, 25 Feb 2020 12:44:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 40EFA2E5C4; Tue, 25 Feb 2020 12:44:20 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.10.132.6] (ptr-8rg5e4hmmr2cl4by1m3.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2408:6002:cc78:83c6:b1e2:7ab]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id B110686E5; Tue, 25 Feb 2020 13:44:17 +0100 (CET) From: "Kristof Provost" To: "Hans Petter Selasky" Cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r358167 - head/sys/netinet6 Date: Tue, 25 Feb 2020 13:44:17 +0100 X-Mailer: MailMate (1.13.1r5671) Message-ID: <963E6D27-9320-4F84-A3BB-A597C829AAAB@FreeBSD.org> In-Reply-To: <7d9ea227-7208-5773-080c-5ebc365c4be0@selasky.org> References: <202002201056.01KAuC0N029186@repo.freebsd.org> <7d9ea227-7208-5773-080c-5ebc365c4be0@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 12:44:22 -0000 On 24 Feb 2020, at 15:21, Hans Petter Selasky wrote: > On 2020-02-20 11:56, Bjoern A. Zeeb wrote: >> + >> + unfragpartlen = optlen + sizeof(struct ip6_hdr); >> + > > Hi Bjoren, > > This change introduces a slight regression when a host replies to IPv6 > ping fragmented packets. The problem is the "unfragpartlen" must also > be set in the else case of "if (opt)", else the payload offset > computation for IPv6 fragments goes wrong by the size of the IPv6 > header! > Confirmed, because the pf fragmentation:v6 test also fails on this. > After r358167: > >> ping6 -s 3000 fe80::ee0d:9aff:fed4:2c8c%mce2 >> PING6(3048=40+8+3000 bytes) fe80::ee0d:9aff:fed4:2c94%mce2 --> >> fe80::ee0d:9aff:fed4:2c8c%mce2 >> ^C >> --- fe80::ee0d:9aff:fed4:2c8c%mce2 ping6 statistics --- >> 2 packets transmitted, 0 packets received, 100.0% packet loss > > With the patch mentioned in the end of this e-mail: > >> ping6 -s 3000 fe80::ee0d:9aff:fed4:2c8c%mce2 >> PING6(3048=40+8+3000 bytes) fe80::ee0d:9aff:fed4:2c8c%mce2 --> >> fe80::ee0d:9aff:fed4:2c8c%mce2 >> 3008 bytes from fe80::ee0d:9aff:fed4:2c8c%mce2, icmp_seq=0 hlim=64 >> time=0.499 ms >> 3008 bytes from fe80::ee0d:9aff:fed4:2c8c%mce2, icmp_seq=1 hlim=64 >> time=0.405 ms >> 3008 bytes from fe80::ee0d:9aff:fed4:2c8c%mce2, icmp_seq=2 hlim=64 >> time=0.097 ms >> ^C >> --- fe80::ee0d:9aff:fed4:2c8c%mce2 ping6 statistics --- >> 3 packets transmitted, 3 packets received, 0.0% packet loss >> round-trip min/avg/max/std-dev = 0.097/0.334/0.499/0.172 ms > > Patch goes like this: > >> diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c >> index 06c57bcec48..a6c8d148833 100644 >> --- a/sys/netinet6/ip6_output.c >> +++ b/sys/netinet6/ip6_output.c >> @@ -459,7 +459,6 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts >> *opt, >> */ >> bzero(&exthdrs, sizeof(exthdrs)); >> optlen = 0; >> - unfragpartlen = 0; >> if (opt) { >> /* Hop-by-Hop options header. */ >> MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh, >> optlen); >> @@ -497,8 +496,6 @@ 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); >> - >> /* >> * NOTE: we don't add AH/ESP length here (done in >> * ip6_ipsec_output()). >> @@ -508,6 +505,8 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts >> *opt, >> MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2, >> optlen); >> } >> + unfragpartlen = optlen + sizeof(struct ip6_hdr); >> + >> /* >> * If there is at least one extension header, >> * separate IP6 header from the payload. > And with this patch the test passes again. Regards, Kristof