summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-08-24 23:28:27 +0000
committermpi <mpi@openbsd.org>2015-08-24 23:28:27 +0000
commit1a0fbffc4ec66cad2843cbc4e1c777bf1c4f6a23 (patch)
tree0f76a642b2b27cd9e7f4ea5c26ea474033f4b3b0 /sys
parentStart moving away from the global prefix list by limiting its usage to (diff)
downloadwireguard-openbsd-1a0fbffc4ec66cad2843cbc4e1c777bf1c4f6a23.tar.xz
wireguard-openbsd-1a0fbffc4ec66cad2843cbc4e1c777bf1c4f6a23.zip
nd6_prefix_add() is no longer used and die.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/nd6.h4
-rw-r--r--sys/netinet6/nd6_rtr.c48
2 files changed, 2 insertions, 50 deletions
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 5761109a161..70be2aedc77 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.h,v 1.47 2015/08/24 23:26:43 mpi Exp $ */
+/* $OpenBSD: nd6.h,v 1.48 2015/08/24 23:28:27 mpi Exp $ */
/* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */
/*
@@ -312,8 +312,6 @@ int nd6_prelist_add(struct nd_prefix *, struct nd_defrouter *,
void pfxlist_onlink_check(void);
struct nd_defrouter *defrouter_lookup(struct in6_addr *, struct ifnet *);
-struct nd_prefix *nd6_prefix_add(struct ifnet *, struct sockaddr_in6 *,
- struct sockaddr_in6 *, struct in6_addrlifetime *);
struct nd_prefix *nd6_prefix_lookup(struct nd_prefix *);
int in6_ifdel(struct ifnet *, struct in6_addr *);
int in6_init_prefix_ltimes(struct nd_prefix *ndpr);
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index bcc93dd8e56..e1a63a94402 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.119 2015/08/24 23:26:43 mpi Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.120 2015/08/24 23:28:27 mpi Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -1069,52 +1069,6 @@ purge_detached(struct ifnet *ifp)
}
}
-struct nd_prefix *
-nd6_prefix_add(struct ifnet *ifp, struct sockaddr_in6 *addr,
- struct sockaddr_in6 *mask, struct in6_addrlifetime *lt)
-{
- struct nd_prefix pr0, *pr;
- int i;
-
- /*
- * convert mask to prefix length (prefixmask has already
- * been validated in in6_update_ifa().
- */
- memset(&pr0, 0, sizeof(pr0));
- pr0.ndpr_ifp = ifp;
- pr0.ndpr_plen = in6_mask2len(&mask->sin6_addr, NULL);
- pr0.ndpr_prefix = *addr;
- pr0.ndpr_mask = mask->sin6_addr;
- /* apply the mask for safety. */
- for (i = 0; i < 4; i++) {
- pr0.ndpr_prefix.sin6_addr.s6_addr32[i] &=
- mask->sin6_addr.s6_addr32[i];
- }
- /*
- * XXX: since we don't have an API to set prefix (not address)
- * lifetimes, we just use the same lifetimes as addresses.
- * The (temporarily) installed lifetimes can be overridden by
- * later advertised RAs (when accept_rtadv is non 0), which is
- * an intended behavior.
- */
- pr0.ndpr_raf_onlink = 1; /* should be configurable? */
- pr0.ndpr_raf_auto = 1;
- pr0.ndpr_vltime = lt->ia6t_vltime;
- pr0.ndpr_pltime = lt->ia6t_pltime;
-
- /* add the prefix if not yet. */
- if ((pr = nd6_prefix_lookup(&pr0)) == NULL) {
- /*
- * nd6_prelist_add will install the corresponding
- * interface route.
- */
- if (nd6_prelist_add(&pr0, NULL, &pr) != 0)
- return (NULL);
- }
-
- return (pr);
-}
-
int
nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr,
struct nd_prefix **newp)