From owner-svn-src-head@freebsd.org Mon Feb 24 14:22:49 2020 Return-Path: Delivered-To: svn-src-head@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 8EC4725DE8E; Mon, 24 Feb 2020 14:22:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48R4600qchz3Kc5; Mon, 24 Feb 2020 14:22:47 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C75602601D2; Mon, 24 Feb 2020 15:22:39 +0100 (CET) Subject: Re: svn commit: r358167 - head/sys/netinet6 To: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002201056.01KAuC0N029186@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <7d9ea227-7208-5773-080c-5ebc365c4be0@selasky.org> Date: Mon, 24 Feb 2020 15:21:24 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <202002201056.01KAuC0N029186@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48R4600qchz3Kc5 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-3.12)[ip: (-9.32), ipnet: 88.99.0.0/16(-4.71), asn: 24940(-1.56), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 14:22:49 -0000 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! 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. --HPS