From nobody Sun Jul 10 16:59:36 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 320B917D3EA4; Sun, 10 Jul 2022 16:59:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LgtXw0xz8z3SZd; Sun, 10 Jul 2022 16:59:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657472384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=H+0ze8ahX3yJI5QZK5UGLfBkuWnPnqoVlo04iLIn7s8=; b=rb32FioRN074m1WfHjRWSYUTVGs83zX8VCmwbeQGDQ+Lv0GyW9vKGWe+7Ppyk+RJoWJrLs 9j34Alof8GYzZUroraiL6I/lBu+lLZdbNTEPNWVDIdsrczAN6Aqj9e1nwNWBZyVtpkapKR gJWB6kBqdWD0aw0fYKbhoJsGszkFLN9l20g2biStkBXumO3C73r6Pdm2iQkmKKUnmwJFUA egWZKxP2iztOFP9h/pmLW1E5QUO+in9u0e8L59AUxA7S5oV/c6NyWfEe60tg5cw+9gcuFO C7qdprH2oR1g30/KXQGggtrbPYKuQhlnCBlXapgbvqHBcYM35QM8Ked5mLdEBQ== Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4LgtXv5mXBz1GrC; Sun, 10 Jul 2022 16:59:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6260D8D4A161; Sun, 10 Jul 2022 16:59:41 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1D578E707D9; Sun, 10 Jul 2022 16:59:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 8l9GZwj7VtUG; Sun, 10 Jul 2022 16:59:38 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 105B0E707AC; Sun, 10 Jul 2022 16:59:37 +0000 (UTC) Date: Sun, 10 Jul 2022 16:59:36 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Alexander V. Chernikov" cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 50fa27e795ea - main - netinet6: fix interface handling for loopback traffic In-Reply-To: <71D08533-EE9B-439F-B8DD-1DF5C46D5862@ipfw.ru> Message-ID: References: <202207101248.26ACmWT1069733@gitrepo.freebsd.org> <71D08533-EE9B-439F-B8DD-1DF5C46D5862@ipfw.ru> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657472384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=H+0ze8ahX3yJI5QZK5UGLfBkuWnPnqoVlo04iLIn7s8=; b=c5unJFF1umsRAQvw7mkkrhs4GqTflNtsXpLdcBUiCNr+U26RZX1vsNGwTt5V1ZHHtl6OWI 4iJR975xUCqv7Z8cJOPvq+TPpC3tgrdSdiYxSFU6kFwnaTrpA0nzh0OGeZp49n3LJvzrKo ILPXb12cD4RJ9ZDezAs+15U1HD6u6F/0s5nKZsFMEQHEoCY9BTt7PzctO4K6GBD92slQxr npgWtXdtVnOCfH/DbVprN7QbE3h/3m6zgnpZywKBjNL5gxUZAtRVOoaabc0cOZ3JpcIdam Deo57CeuFWdYGziWhqszkxIlOlHA+KRBNARIqJV2Gs/FsoLu1UzuAtQT6x/YNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657472384; a=rsa-sha256; cv=none; b=Ztb6joEYKxnFV5kcBDABlKyq1uL6JskBzLi7qFPTVTqH6SX6vXvWN+OJ/Jyb8KUMR+NRae RtIceIHzrSOlvHLpMe4nrWOdxl8cIMAIOKQ9h7+qnB5isxzcdkx7aMqXIwGHRAU3Ii9RZI WM0Z04Q5y4oYVuMl1+yKwnhVnjJAkefydNU6MRhM2KbjkqeyTBj/wVNb/88bIpdRtg+ZO4 HzrPyFPK5WD1FQ2U/TNQFyeDlhYgEhXy4U5VNBr3sW7rFZMlbF/+1ygxf/wc2dKjvSMCM0 To+iiQRexxkfibwJ6bpv+uPltcNfNFrGyZSdOD4KyH4NDJOlf1pv9ZCsBt5KDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Sun, 10 Jul 2022, Alexander V. Chernikov wrote: > > >> On 10 Jul 2022, at 14:32, Bjoern A. Zeeb wrote: >> >> On Sun, 10 Jul 2022, Alexander V. Chernikov wrote: >> >>> The branch main has been updated by melifaro: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=50fa27e795eaae97dae87ac4532799f7aea87e9f >>> >>> 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 >>> >>> netinet6: fix interface handling for loopback traffic >>> >>> 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 >>> >>> 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. >>> >>> PR: 265089 >>> Reviewed by: ae, bz(previous version) >> >> 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? No, I would have prefered more than 4 days of time to look at the updated changes after 4 months, but I can still do that now that things are in. Just keep going, we'll take it from here. >> >> >>> 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(-) >> >> -- >> Bjoern A. Zeeb r15:7 > > -- Bjoern A. Zeeb r15:7