Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Apr 2026 08:52:04 +0000
From:      Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 43caeea1eac8 - stable/15 - routing: Make ip[6]_tryforward() FIB-aware for local traffic
Message-ID:  <69e73ab4.321ac.6e164e0c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by pouria:

URL: https://cgit.FreeBSD.org/src/commit/?id=43caeea1eac8e8eaa2dd89479e5a699f786de88f

commit 43caeea1eac8e8eaa2dd89479e5a699f786de88f
Author:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-04-11 12:58:28 +0000
Commit:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-04-21 08:50:36 +0000

    routing: Make ip[6]_tryforward() FIB-aware for local traffic
    
    `ip_tryforward()` and `ip6_tryforward()` checks whether the destination
    address is local or not without considering if it belongs to the current FIB.
    If the destination is local but not in our FIB, forward it instead
    of returning it to ip_input().
    
    PR:             292319
    Reviewed by:    zlei
    MFC after:      1 week
    MFC to:         stable/15
    Differential Revision: https://reviews.freebsd.org/D56353
    
    (cherry picked from commit bf41d86df0d9dc4a1342c579f4e72db3c66b3443)
---
 sys/netinet/ip_fastfwd.c   | 4 ++--
 sys/netinet6/ip6_fastfwd.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c
index 51e7c2fbc4b0..c567d28f24f0 100644
--- a/sys/netinet/ip_fastfwd.c
+++ b/sys/netinet/ip_fastfwd.c
@@ -294,7 +294,7 @@ ip_tryforward(struct mbuf *m)
 	/*
 	 * Is it for a local address on this host?
 	 */
-	if (in_localip(ip->ip_dst))
+	if (in_localip_fib(ip->ip_dst, M_GETFIB(m)))
 		return m;
 
 	IPSTAT_INC(ips_total);
@@ -329,7 +329,7 @@ ip_tryforward(struct mbuf *m)
 		/*
 		 * Is it now for a local address on this host?
 		 */
-		if (in_localip(dest))
+		if (in_localip_fib(dest, M_GETFIB(m)))
 			goto forwardlocal;
 		/*
 		 * Go on with new destination address
diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c
index 7139267722b7..8a8468ae7da6 100644
--- a/sys/netinet6/ip6_fastfwd.c
+++ b/sys/netinet6/ip6_fastfwd.c
@@ -114,7 +114,7 @@ ip6_tryforward(struct mbuf *m)
 	    IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) ||
 	    IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst) ||
 	    IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) ||
-	    in6_localip(&ip6->ip6_dst))
+	    in6_localip_fib(&ip6->ip6_dst, M_GETFIB(m)))
 		return (m);
 	/*
 	 * Check that the amount of data in the buffers


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e73ab4.321ac.6e164e0c>