From nobody Sun Jul 10 14:18:13 2022 X-Original-To: dev-commits-src-all@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 959ED1D0DFB2; Sun, 10 Jul 2022 14:18:23 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501j.mail.yandex.net (forward501j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lgpyj0p0wz4B8J; Sun, 10 Jul 2022 14:18:20 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from sas2-ccf8d202a952.qloud-c.yandex.net (sas2-ccf8d202a952.qloud-c.yandex.net [IPv6:2a02:6b8:c08:b7ad:0:640:ccf8:d202]) by forward501j.mail.yandex.net (Yandex) with ESMTP id A40D0623653; Sun, 10 Jul 2022 17:18:16 +0300 (MSK) Received: from sas1-384d3eaa6677.qloud-c.yandex.net (sas1-384d3eaa6677.qloud-c.yandex.net [2a02:6b8:c14:3a29:0:640:384d:3eaa]) by sas2-ccf8d202a952.qloud-c.yandex.net (mxback/Yandex) with ESMTP id gAjfjzKXE9-IGDejZgl; Sun, 10 Jul 2022 17:18:16 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1657462696; bh=NT5OnCUVOIeonTrEJFMCl2y0/tv02C3xyThU0Ho8WgQ=; h=References:Date:In-Reply-To:Subject:Cc:From:Message-Id:To; b=ZyRhLw4yV2L7vlDvK0ud/8bHFzRnNemmXGnBFBhYgrV7RZ7WjqIpSL9gH3NpiNcOI N0A8SV9BCjR79Jtf6xBGeQ8+1AgKf8+3m+noanxSuepyVs5dNvciBvFFeAa7Qm02lw 1g6zaD74YL9X9ryYvotlQpyMeSVqTbkyjXLXYqSI= Received: by sas1-384d3eaa6677.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 9P53mHSnHC-IFdWgd6L; Sun, 10 Jul 2022 17:18:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: git: 50fa27e795ea - main - netinet6: fix interface handling for loopback traffic From: "Alexander V. Chernikov" In-Reply-To: Date: Sun, 10 Jul 2022 15:18:13 +0100 Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <71D08533-EE9B-439F-B8DD-1DF5C46D5862@ipfw.ru> References: <202207101248.26ACmWT1069733@gitrepo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3696.100.31) X-Rspamd-Queue-Id: 4Lgpyj0p0wz4B8J X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=ZyRhLw4y; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:801:2::111 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0::/52]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:801:2::111:from]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:208722, ipnet:2a02:6b8::/32, country:FI]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEFALL_USER(0.00)[melifaro]; DMARC_NA(0.00)[ipfw.ru]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 10 Jul 2022, at 14:32, Bjoern A. Zeeb wrote: >=20 > On Sun, 10 Jul 2022, Alexander V. Chernikov wrote: >=20 >> The branch main has been updated by melifaro: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D50fa27e795eaae97dae87ac4532799f7= aea87e9f >>=20 >> commit 50fa27e795eaae97dae87ac4532799f7aea87e9f >> Author: Alexander V. Chernikov >> AuthorDate: 2022-07-10 12:27:23 +0000 >> Commit: Alexander V. Chernikov >> CommitDate: 2022-07-10 12:47:47 +0000 >>=20 >> netinet6: fix interface handling for loopback traffic >>=20 >> Currently, processing of IPv6 local traffic is partially broken: >> link-local connection fails and global unicast connect() takes >> 3 seconds to complete. >> This happens due to the combination of multiple factors. >> IPv6 code passes original interface "origifp" when passing >> traffic via loopack to retain the scope that is mandatory for the >> correct hadling of link-local traffic. First problem is that the = logic >> of passing source interface is not working correcly for TCP = connections, >> resulting in passing "origifp" on the first 2 connection attempts and >> lo0 on the subsequent ones. Second problem is that source address >> validation logic skips its checks iff the source interface is = loopback, >> which doesn't cover "origifp" case. >> More detailed description is available at = https://reviews.freebsd.org/D35732 >>=20 >> Fix the first problem by untangling&simplifying ifp/origifp logic. >> Fix the second problem by switching source address validation check = to >> using M_LOOP mbuf flag instead of interface type. >>=20 >> PR: 265089 >> Reviewed by: ae, bz(previous version) >=20 > I did not review, I had only commented on D35117. Sorry, I chose a wrong wording for mentioning the discussion happened. Do you prefer me to rollback/commit with an updated message? >=20 >=20 >> Differential Revision: https://reviews.freebsd.org/D35732 >> MFC after: 2 weeks >> --- >> sys/netinet6/ip6_input.c | 2 +- >> sys/netinet6/ip6_output.c | 61 ++++++++++++++++++----------------- >> tests/sys/netinet6/test_ip6_output.py | 4 +-- >> 3 files changed, 35 insertions(+), 32 deletions(-) >=20 > --=20 > Bjoern A. Zeeb r15:7