summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-08 10:46:06 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-08 10:46:06 +0000
commit49ecd5fc47825a7f0401cfc10041596d5f5fd046 (patch)
treea055914ca13968dca68682d3200a7f75f02662b8 /sys/net/if.c
parentddecac01ab7b8fc302541dfda91fb36ad43884d9 (diff)
RIP ifa_ifwithnet()
ok vgross@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index b7c9e11dfbb..c422f23ddc9 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.456 2016/10/19 02:05:49 yasuoka Exp $ */
+/* $OpenBSD: if.c,v 1.457 2016/11/08 10:46:04 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1282,47 +1282,6 @@ ifa_ifwithdstaddr(struct sockaddr *addr, u_int rdomain)
}
/*
- * Find an interface on a specific network. If many, choice
- * is most specific found.
- */
-struct ifaddr *
-ifa_ifwithnet(struct sockaddr *sa, u_int rtableid)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa, *ifa_maybe = NULL;
- char *cplim, *addr_data = sa->sa_data;
- u_int rdomain;
-
- KERNEL_ASSERT_LOCKED();
- rdomain = rtable_l2(rtableid);
- TAILQ_FOREACH(ifp, &ifnet, if_list) {
- if (ifp->if_rdomain != rdomain)
- continue;
- TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
- char *cp, *cp2, *cp3;
-
- if (ifa->ifa_addr->sa_family != sa->sa_family ||
- ifa->ifa_netmask == 0)
- next: continue;
- cp = addr_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = (char *)ifa->ifa_netmask +
- ifa->ifa_netmask->sa_len;
- while (cp3 < cplim)
- if ((*cp++ ^ *cp2++) & *cp3++)
- /* want to continue for() loop */
- goto next;
- if (ifa_maybe == 0 ||
- rn_refines((caddr_t)ifa->ifa_netmask,
- (caddr_t)ifa_maybe->ifa_netmask))
- ifa_maybe = ifa;
- }
- }
- return (ifa_maybe);
-}
-
-/*
* Find an interface address specific to an interface best matching
* a given address.
*/