diff options
| author | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-07-28 08:07:39 +0000 |
|---|---|---|
| committer | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-07-28 08:08:37 +0000 |
| commit | 84f062e3364ef29bc7db5310d960963dc9df2845 (patch) | |
| tree | c82e2ae0b6bee89f2e5c00b91c95c344b1f60a6e | |
| parent | 76363a797043aa2dbbcb0e589146b5002033905a (diff) | |
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
| -rw-r--r-- | sys/net/route.c | 3 |
1 files changed, 1 insertions, 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)); |
