From nobody Sun Jul 10 13:32:52 2022 X-Original-To: dev-commits-src-main@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 60E931D07F0D; Sun, 10 Jul 2022 13:32:59 +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 4LgnyM2JR0z44Wr; Sun, 10 Jul 2022 13:32:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657459979; 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=ksNr0iKPY9XZSyYzRGJGBR5NoA8dGSx8WQnl/nBqNtE=; b=shjtoJNoA3tCihP5BjdRAQ6vMQFezUqRem8H7Eb8VKOv9jV0wzC5o1naMA1ffO2PIXPaAA aRLfMpGX0zqD46dkDuTkan4jX1BnJRsyEagZEILHjP5+doB9jGZeQF4ddbqB9RFuVMGANY SbAo8FN6cpUB1Knd43W+VlyIie7woW6gXGR9ccO2cu8spruHoPJjVY9HY0cKqZBLI9riGZ j6zP1oaF3ebwSrZVgtLe6ewetavCzbBhU+RXsIJ7DetzHhc8Sh1np0MchKwCc8M4bxuo77 xBVzoQ99Fjvd/L3rVYUVqfqzKjbyGvcmS/+4+8qPgynnVGf1WDcmnKN0yB+ZoQ== 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 4LgnyM0mYTz1DjZ; Sun, 10 Jul 2022 13:32:59 +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 66A448D4A161; Sun, 10 Jul 2022 13:32:56 +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 C529CE707D9; Sun, 10 Jul 2022 13:32:55 +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 MLdxu4KEBHie; Sun, 10 Jul 2022 13:32:53 +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 9B9C4E707AC; Sun, 10 Jul 2022 13:32:53 +0000 (UTC) Date: Sun, 10 Jul 2022 13:32:52 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Alexander V. Chernikov" cc: 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: <202207101248.26ACmWT1069733@gitrepo.freebsd.org> Message-ID: References: <202207101248.26ACmWT1069733@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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=1657459979; 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=ksNr0iKPY9XZSyYzRGJGBR5NoA8dGSx8WQnl/nBqNtE=; b=sWakMvoxStgYeUDvbmJE/sGcPCV7wfltj3z54wiX5pDp0JABxz310AojLFqxTsl71kAF+Q Tkg7h6fmFkZPTZBVRfHJ2BKeJqCVdHhfCSPxw1pJXPLk3T/DmO6uG5tOUlIIER2nw/ocnV cWnHwUrngfJJXQkQJKoAhDU+xR0A0/W7Y5t7uOpaPvOI9PdGz8aybyxXNjFs7moAydNF2S SHLlbH4KX5ZjRDD+gPl2fJiNAmwKKn3ulmh1zCG8Bwe/hodnBrjJRdCE7ICruH4uXyouJD hgZQQhzbNiFpLIbGQ1obdG5ycwLz6UcqoZASA6cp143OFI6SqsAVBozbrIiBgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657459979; a=rsa-sha256; cv=none; b=Xo0HpedOpUDn9jVTBKuEqQr8IaVjhrSgGHvKf5eXRuOhebv+ubjRL7Cf+y9EsOmAJMpRcw gpeHG0YoB3rHWBy0tYGRGV6eI7svH0cBftoJJwLHc5lE6Z6N8ZNTkASc9Yt8YmNgwcZo+C se5TjLzYh6svV3BcGIbFgVNaGCtRZKhby998xKSt5hn/oLvOIKH0KiEo4k/JtgSLGO4x69 2bAqfrd9EUWnil8UiJvciiUEJUHWNmQJeeiSh10c6R6JDXJWufcu/U+Wn+sdXvakLV+ImI 9HjgStqcm2MdQvpOgiwPVB9XoG2CZeVdi7sPBsTwbwxAgOiS4upito8YslXX/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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. > 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