From nobody Thu Sep 17 13:18:39 2026 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 4hlxCn0NpDz6t2LZ for ; Thu, 17 Sep 2026 13:18:45 +0000 (UTC) (envelope-from git@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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hlxCm5TKTz4vbL for ; Thu, 17 Sep 2026 13:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789651124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vzeKETZkujfyLQSxhmtF1mDRg0BsmLHyBvDf/7hLX+s=; b=ErsgMWlrHewnfWWGMJqsG1gDt+IHDgVIg0Xm+9iFMdpjp+6dwJx+Kao8GRkVfReyjlHgKS CCILf8of5lD2xZ1Cbu3jBH0XpTi6mCEUnX46gRwSD08jh4WstKGseJqj/XYquIx+2Y+1Np 7ivMDAfUubZklp6yDRt9NMN5dhObJ1EZjX+IxH8XBTRMu2kRgbH4ZBtgz9fLbdZL34rVnC e2Q+IxNywOF+zydnoZBOf/loIXmNoyuZLmzeeiBhR4n1XhuL8XsrpTP3EAamTX+dqqYaRD wSVaYrR34BUbtOMhsm/0SRoZ4Ekq7/hjx31h+b5S5hJnnee3ku6+OmAxJxe1NQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789651124; b=wsXlF892+eEorGgyFeyOpGEiujGUFx6wS3P04IrUhjRiOcg96nN99USuSNzCTvK8vEUNFS R4sFUJ96AVUs3ffdepK7/ATcBayEwz9KA1dd/26KlpMHQkfoqfW/b2TWXdqDRAA6nMhnOE NBxM1b+TxZ336nrjkgl2Of05ZmdjHJ/v+aGQL+4RnceMlC23vD7ZL7YdavDEQcf4ghE61G vOEoOmNkOhDwSWuorMsFUfflq1CYgGEb/qbjISQfqCUWDcKZWgqJqxEafp/AyVRisL6uyZ mfFXZtqi8aq80oEFergW3Cgl/E1IX8qdgSSRjotZU1vna7VLlJh5b6rPUt6ddQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789651124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vzeKETZkujfyLQSxhmtF1mDRg0BsmLHyBvDf/7hLX+s=; b=oJChEsan15GePWLejB3GRqdRNje7qiJ23Ky9OajirhnweTkh+CcRYWPsoVMow+Zi6+Ntyk j8ICZAPrEBNoVVeQIIgFFRqtbLTbDeAxLSeWCndw9ltObEJi4qI9Zwv6SPo63mpOpj52NM 5iYDiVsEXRb9UpYt7wveJmZxuFJfLn22nkkgUn83aVNwaQ0s9bJFoR4vD2e6hQUipvgHZP 8jr1/nx6tXeIdbmTnR36JwtJDqP3lAJnaYt8W+ypSb6goJGyPazwv16sYyTrKVFWKyXKGZ 3X9eJimP3EuZbPwSWz3ff+23tWr+A1n8ZfhEEAwohtD+nGdoFqUc/vLEGnSxvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hlxCm3hb3zZTx for ; Thu, 17 Sep 2026 13:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3344e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 17 Sep 2026 13:18:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 01a95394abfd - main - icmp: Limit routing table updates to the FIB of the redirect 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01a95394abfdef2adb3216e74d88b9c33321260e Auto-Submitted: auto-generated Date: Thu, 17 Sep 2026 13:18:39 +0000 Message-Id: <6aabe8af.3344e.1aa16a24@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=01a95394abfdef2adb3216e74d88b9c33321260e commit 01a95394abfdef2adb3216e74d88b9c33321260e Author: Mark Johnston AuthorDate: 2026-09-17 13:14:49 +0000 Commit: Mark Johnston CommitDate: 2026-09-17 13:17:49 +0000 icmp: Limit routing table updates to the FIB of the redirect When we receive an ICMP redirect, rib_add_redirect() is used to apply the redirect to all FIBs. This has been the case since support for multiple FIBs was added. However, it seems rather dubious: the new gateway might not be routable from all FIBs, and the validation done for v4 redirects in icmp_verify_redirect_gateway() is only applied to the FIB from which the redirect originated. Modify the handler to apply the redirect only in the originating FIB. Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai Reviewed by: pouria, zlei, glebius, melifaro MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59567 --- sys/netinet/ip_icmp.c | 11 ++++------- sys/netinet6/icmp6.c | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index fd1a3cd24c8f..ef7b931e1d93 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -463,7 +463,6 @@ icmp_input(struct mbuf **mp, int *offp, int proto) int hlen = *offp; int icmplen = ntohs(ip->ip_len) - *offp; int i, code; - int fibnum; NET_EPOCH_ASSERT(); @@ -729,12 +728,10 @@ reflect: break; } - for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rib_add_redirect(fibnum, (struct sockaddr *)&icmpsrc, - (struct sockaddr *)&icmpdst, - (struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif, - RTF_GATEWAY, V_redirtimeout); - } + rib_add_redirect(M_GETFIB(m), (struct sockaddr *)&icmpsrc, + (struct sockaddr *)&icmpdst, + (struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif, + RTF_GATEWAY, V_redirtimeout); break; /* diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index e92a433c21b1..4cb00603e6b0 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2328,7 +2328,6 @@ icmp6_redirect_input(struct mbuf *m, int off) struct sockaddr_in6 ssrc; struct sockaddr *gw; int rt_flags; - u_int fibnum; bzero(&sdst, sizeof(sdst)); bzero(&ssrc, sizeof(ssrc)); @@ -2347,10 +2346,9 @@ icmp6_redirect_input(struct mbuf *m, int off) rt_flags |= RTF_GATEWAY; } else gw = ifp->if_addr->ifa_addr; - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) - rib_add_redirect(fibnum, (struct sockaddr *)&sdst, gw, - (struct sockaddr *)&ssrc, ifp, rt_flags, - V_icmp6_redirtimeout); + rib_add_redirect(M_GETFIB(m), (struct sockaddr *)&sdst, gw, + (struct sockaddr *)&ssrc, ifp, rt_flags, + V_icmp6_redirtimeout); } freeit: