Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168889992
D58305.id182141.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58305.id182141.diff
View Options
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1708,18 +1708,18 @@
}
/*
- * Locate an interface based on a complete address.
+ * Locate an interface on the specified fib based on a complete address.
*/
-/*ARGSUSED*/
struct ifaddr *
-ifa_ifwithaddr(const struct sockaddr *addr)
+ifa_ifwithaddr_fib(const struct sockaddr *addr, int fibnum)
{
struct ifnet *ifp;
struct ifaddr *ifa;
NET_EPOCH_ASSERT();
-
CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
+ if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum))
+ continue;
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != addr->sa_family)
continue;
@@ -1740,6 +1740,17 @@
return (ifa);
}
+/*
+ * Locate an interface based on a complete address.
+ */
+/*ARGSUSED*/
+struct ifaddr *
+ifa_ifwithaddr(const struct sockaddr *addr)
+{
+
+ return (ifa_ifwithaddr_fib(addr, RT_ALL_FIBS));
+}
+
int
ifa_ifwithaddr_check(const struct sockaddr *addr)
{
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -563,6 +563,7 @@
int ifa_del_loopback_route(struct ifaddr *, struct sockaddr *);
int ifa_switch_loopback_route(struct ifaddr *, struct sockaddr *);
+struct ifaddr *ifa_ifwithaddr_fib(const struct sockaddr *, int);
struct ifaddr *ifa_ifwithaddr(const struct sockaddr *);
int ifa_ifwithaddr_check(const struct sockaddr *);
struct ifaddr *ifa_ifwithbroadaddr(const struct sockaddr *, int);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 31, 3:25 PM (22 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37697551
Default Alt Text
D58305.id182141.diff (1 KB)
Attached To
Mode
D58305: net/if.c: Add fib-aware ifa_ifwithaddr()
Attached
Detach File
Event Timeline
Log In to Comment