From nobody Sat Jun 19 18:02:01 2021 X-Original-To: net@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 5F65111CCF7A for ; Sat, 19 Jun 2021 18:02:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G6kBx1q1fz4Y0M for ; Sat, 19 Jun 2021 18:02:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26E511ADB3 for ; Sat, 19 Jun 2021 18:02:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 15JI21Z4015569 for ; Sat, 19 Jun 2021 18:02:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 15JI21qV015568 for net@FreeBSD.org; Sat, 19 Jun 2021 18:02:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 256681] [route] Incorrect loopback route for aliases IP addresses Date: Sat, 19 Jun 2021 18:02:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: zlei.huang@gmail.com X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: melifaro@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256681 --- Comment #4 from Zhenlei Huang --- (In reply to Rodney W. Grimes from comment #3) Comparing to stable/12 and stable/11, I call the route is "expected". Spent hours to repeat this on previous releases. Prior to FreeBSD 8.0, upon adding IP address to interface, only the on-link prefix route will be created. As for /32 aliases, the prefix route is /32. = For output routine, ip_output() will consult rtalloc() to "generate" the loopba= ck route for local IP address and use it. From FreeBSD 8.0 to FreeBSD 12.2, the on-link prefix route will be created,= as well as the loopback route for local IP address. See [1].=20 From FreeBSD 13.0 and onward, due to significant rework of routing subsyste= m, route for the /32 aliases is treated specially. See [2]. I reviewed the design of loopback route. If I understand correctly, the loopback route short cut the out path of packets those are destined for loc= al, it directly forward it to local and bypass the physical interface. See [3]. So in some cases, if the loopback route is disabled and the hardware/logical interface can not forward those packets destined for local, 'No route to ho= st' should be generated. PS, there is a 'net.link.ether.inet.useloopback' sysctl tunable, it is defa= ult on, and controls whether installing a loopback route or not. This tunable existed at least since 4.11 and was removed from stable/11. See [4]. [1]: https://cgit.freebsd.org/src/commit/sys/netinet/in.c?h=3Dstable/8&id=3Debc9= 0701ac6c1f814c5bd6f3e19f0113ebe06156 [2]: https://reviews.freebsd.org/D28668 [3]: https://cgit.freebsd.org/src/tree/sys/netinet/if_ether.c?h=3Dstable/4#= n109 [4]: https://cgit.freebsd.org/src/commit/sys/netinet/if_ether.c?h=3Dstable/11&id= =3Db1b9dcae46803ae79255a9994584cb03d2a77048 --=20 You are receiving this mail because: You are on the CC list for the bug.=