git: 84f062e3364e - main - routing: Limit enumeration of ifas to fib in rt_getifa_fib
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Jul 2026 08:10:49 UTC
The branch main has been updated by pouria:
URL: https://cgit.FreeBSD.org/src/commit/?id=84f062e3364ef29bc7db5310d960963dc9df2845
commit 84f062e3364ef29bc7db5310d960963dc9df2845
Author: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-07-28 08:07:39 +0000
Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
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));