From nobody Fri Apr 15 22:05:49 2022 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C4E888D3E1D for ; Fri, 15 Apr 2022 22:05:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kg9Pv2LMyz3Nrq; Fri, 15 Apr 2022 22:05:55 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:3510:e557:b337:101a]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 747D1721E2806; Sat, 16 Apr 2022 00:05:50 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: IPv6 TCP: first two SYN packets to local v6 unicast addresses ignored From: tuexen@freebsd.org In-Reply-To: <9679642b-5de6-28be-a64b-07375c3efeba@smeets.xyz> Date: Sat, 16 Apr 2022 00:05:49 +0200 Cc: Gleb Smirnoff , current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <46089B86-EF4C-4E4A-9240-51FEACE2BE3C@freebsd.org> References: <131c363a-7b7d-a106-5b8a-6838e7a66567@smeets.xyz> <9679642b-5de6-28be-a64b-07375c3efeba@smeets.xyz> To: Florian Smeets X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4Kg9Pv2LMyz3Nrq X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 2001:638:a02:a001:20e:cff:fe4a:feaa is neither permitted nor denied by domain of tuexen@freebsd.org) smtp.mailfrom=tuexen@freebsd.org X-Spamd-Result: default: False [-2.56 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[tuexen]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_SOFTFAIL(0.00)[~all]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.964]; FROM_NO_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MLMMJ_DEST(0.00)[current]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 15. Apr 2022, at 23:39, Florian Smeets wrote: >=20 > On 15.04.22 21:24, tuexen@freebsd.org wrote: >>> On 15. Apr 2022, at 20:20, Florian Smeets wrote: >>>=20 >>>=20 >>> Hi, >>>=20 >>> there seems to be an issue with local IPv6 TCP connections on main. = I have been seeing this for a couple of months at least. pkg upgr on my = webserver hosting the pkg repo is very slow, all other hosts can connect = to the pkg repo just fine. So IPv6 connections from external hosts are = not affected. >>>=20 >>> I thought I must have misconfigured something, as my setup is a bit = weird. Yesterday I noticed the same issue on a different host, turns out = all my 14.0 hosts seem to be affected, cognet@ could also reproduce it = on one of his systems. >>>=20 >>> The service/software used does not seem to matter, I tried with port = 22, 25, 80 and 443. >>>=20 >>> ICMP and UDP don't seem to be affected. ping6 gets replies = immediately. And UDP connections with nc -l -u / nc -u don't have any = delay, sent data is received immediately. >>>=20 >>> Testing local TCP connections show this: >>>=20 >>> flo@rp64:~ $ ifconfig dwc0|grep 2003 >>> inet6 2003:cf:df49:c97:4c59:ebff:fec1:463d prefixlen 64 autoconf >>> flo@rp64:~ $ nc -v 2003:cf:df49:c97:4c59:ebff:fec1:463d 22 >>> [3 second delay here] >>> Connection to 2003:cf:df49:c97:4c59:ebff:fec1:463d 22 port [tcp/ssh] = succeeded! >>> SSH-2.0-OpenSSH_8.9 FreeBSD-20220413 >>>=20 >=20 >>>=20 >>> I need help debugging this, I don't know how to analyze this = further. I will start bisecting this, but I thought maybe someone has an = idea. >> Hi Florian, >> I can reproduce this locally, will try to figure out what is going = on. If you can bisect it, it would be great. >=20 > Found the culprit 1817be481b8703ae86730b151a6f49cc3022930f. And indeed = toggling net.inet6.ip6.source_address_validation makes the issue go away = on latest main. Cool, thanks for providing the information. However, I don't understand = why results in dropping the first two SYN segments (this should not = happen) and why the third is accepted (they should all treated the same). Best regards Michael >=20 > Florian >