aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2014-09-11 20:21:03 +0000
committerAlan Somers <asomers@FreeBSD.org>2014-09-11 20:21:03 +0000
commit4f8585e021ec9c2190932c2890dc0960999e4591 (patch)
tree71b9208dfb55df9be34d49b1987c426f39a452cb /sys/net/if.c
parent0686a20b8a0e7a18faaae792a189f9e7a9aabf62 (diff)
downloadsrc-4f8585e021ec9c2190932c2890dc0960999e4591.tar.gz
src-4f8585e021ec9c2190932c2890dc0960999e4591.zip
Revisions 264905 and 266860 added a "int fib" argument to ifa_ifwithnet and
ifa_ifwithdstaddr. For the sake of backwards compatibility, the new arguments were added to new functions named ifa_ifwithnet_fib and ifa_ifwithdstaddr_fib, while the old functions became wrappers around the new ones that passed RT_ALL_FIBS for the fib argument. However, the backwards compatibility is not desired for FreeBSD 11, because there are numerous other incompatible changes to the ifnet(9) API. We therefore decided to remove it from head but leave it in place for stable/9 and stable/10. In addition, this commit adds the fib argument to ifa_ifwithbroadaddr for consistency's sake. sys/sys/param.h Increment __FreeBSD_version sys/net/if.c sys/net/if_var.h sys/net/route.c Add fibnum argument to ifa_ifwithbroadaddr, and remove the _fib versions of ifa_ifwithdstaddr, ifa_ifwithnet, and ifa_ifwithroute. sys/net/route.c sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_options.c sys/netinet/ip_output.c sys/netinet6/nd6.c Fixup calls of modified functions. share/man/man9/ifnet.9 Document changed API. CR: https://reviews.freebsd.org/D458 MFC after: Never Sponsored by: Spectra Logic
Notes
Notes: svn path=/head/; revision=271438
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 06993e3cb46e..017af336d2b6 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1694,13 +1694,15 @@ ifa_ifwithaddr_check(struct sockaddr *addr)
*/
/* ARGSUSED */
struct ifaddr *
-ifa_ifwithbroadaddr(struct sockaddr *addr)
+ifa_ifwithbroadaddr(struct sockaddr *addr, int fibnum)
{
struct ifnet *ifp;
struct ifaddr *ifa;
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
+ if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum))
+ continue;
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != addr->sa_family)
@@ -1727,7 +1729,7 @@ done:
*/
/*ARGSUSED*/
struct ifaddr *
-ifa_ifwithdstaddr_fib(struct sockaddr *addr, int fibnum)
+ifa_ifwithdstaddr(struct sockaddr *addr, int fibnum)
{
struct ifnet *ifp;
struct ifaddr *ifa;
@@ -1757,19 +1759,12 @@ done:
return (ifa);
}
-struct ifaddr *
-ifa_ifwithdstaddr(struct sockaddr *addr)
-{
-
- return (ifa_ifwithdstaddr_fib(addr, RT_ALL_FIBS));
-}
-
/*
* Find an interface on a specific network. If many, choice
* is most specific found.
*/
struct ifaddr *
-ifa_ifwithnet_fib(struct sockaddr *addr, int ignore_ptp, int fibnum)
+ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp, int fibnum)
{
struct ifnet *ifp;
struct ifaddr *ifa;
@@ -1867,13 +1862,6 @@ done:
return (ifa);
}
-struct ifaddr *
-ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp)
-{
-
- return (ifa_ifwithnet_fib(addr, ignore_ptp, RT_ALL_FIBS));
-}
-
/*
* Find an interface address specific to an interface best matching
* a given address.