summaryrefslogtreecommitdiff
path: root/sys
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
parentddecac01ab7b8fc302541dfda91fb36ad43884d9 (diff)
RIP ifa_ifwithnet()
ok vgross@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c43
-rw-r--r--sys/net/if_var.h3
2 files changed, 2 insertions, 44 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.
*/
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 0694826a8ce..31915b410e6 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_var.h,v 1.75 2016/09/04 15:46:39 reyk Exp $ */
+/* $OpenBSD: if_var.h,v 1.76 2016/11/08 10:46:05 mpi Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -304,7 +304,6 @@ void p2p_rtrequest(struct ifnet *, int, struct rtentry *);
struct ifaddr *ifa_ifwithaddr(struct sockaddr *, u_int);
struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *, u_int);
-struct ifaddr *ifa_ifwithnet(struct sockaddr *, u_int);
struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *);
void ifafree(struct ifaddr *);