git: 84f062e3364e - main - routing: Limit enumeration of ifas to fib in rt_getifa_fib

Pouria Mousavizadeh Tehrani <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a686409.4398a.4aa52d3e__22175.2872619376$1785226266$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by pouria:

URL: https://cgit.FreeBSD.org/src/commit/?id=84f062e3364ef29bc7db5310d960963dc9df2845

commit 84f062e3364ef29bc7db5310d960963dc9df2845
Author:     Pouria Mousavizadeh Tehrani <[email protected]>
AuthorDate: 2026-07-28 08:07:39 +0000
Commit:     Pouria Mousavizadeh Tehrani <[email protected]>
CommitDate: 2026-07-28 08:08:37 +0000

    routing: Limit enumeration of ifas to fib in rt_getifa_fib
    
    If we have source address specified, try to find it by enumerating
    ifas on specified fib.
    
    Reviewed by: glebius
    Differential Revision: https://reviews.freebsd.org/D58444
---
 sys/net/route.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/net/route.c b/sys/net/route.c
index 9ed3a53cbfcb..cbe84ba5fba9 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -452,10 +452,9 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum)
 		info->rti_ifp = info_get_ifp(info);
 	/*
 	 * If we have source address specified, try to find it
-	 * TODO: avoid enumerating all ifas on all interfaces.
 	 */
 	if (info->rti_ifa == NULL && ifaaddr != NULL)
-		info->rti_ifa = ifa_ifwithaddr(ifaaddr);
+		info->rti_ifa = ifa_ifwithaddr_fib(ifaaddr, fibnum);
 	if ((info->rti_ifa == NULL) && ((info->rti_flags & RTF_GATEWAY) != 0) &&
 	    (gateway->sa_family != dst->sa_family))
 		return (rt_getifa_family(info, fibnum));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.