diff options
author | 2013-03-11 14:08:03 +0000 | |
---|---|---|
committer | 2013-03-11 14:08:03 +0000 | |
commit | def0ec577b954026acb6cbdeeb97f19d70dda867 (patch) | |
tree | 3b08c5d4f1f664eacc5063b826a9d250c18522ab | |
parent | Remove the -I option, even if the ioctls for manipulating a default (diff) | |
download | wireguard-openbsd-def0ec577b954026acb6cbdeeb97f19d70dda867.tar.xz wireguard-openbsd-def0ec577b954026acb6cbdeeb97f19d70dda867.zip |
Remove unused code manipulating a default interface and its index,
This is a leftover from the on-link assumption behavior removal,
which has been deprecated by RFC4861 anyway.
ok mikeb@, bluhm@, florian@
-rw-r--r-- | sys/netinet6/in6.c | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_var.h | 5 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 24 | ||||
-rw-r--r-- | sys/netinet6/nd6.h | 6 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 26 |
5 files changed, 5 insertions, 60 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index d1500ea6c8f..bd7dc11bdd4 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.105 2013/03/07 09:03:16 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.106 2013/03/11 14:08:03 mpi Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -358,7 +358,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, case SIOCSNDFLUSH_IN6: case SIOCSPFXFLUSH_IN6: case SIOCSRTRFLUSH_IN6: - case SIOCSDEFIFACE_IN6: case SIOCSIFINFO_FLAGS: if (!privileged) return (EPERM); @@ -368,7 +367,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, case SIOCGDRLST_IN6: case SIOCGPRLST_IN6: case SIOCGNBRINFO_IN6: - case SIOCGDEFIFACE_IN6: return (nd6_ioctl(cmd, data, ifp)); } diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index aa8420b19cc..b2dbd4b5c34 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_var.h,v 1.36 2013/03/04 14:23:35 bluhm Exp $ */ +/* $OpenBSD: in6_var.h,v 1.37 2013/03/11 14:08:04 mpi Exp $ */ /* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */ /* @@ -416,9 +416,6 @@ struct in6_rrenumreq { #define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) #define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) -#define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq) -#define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq) - #define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ #define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 9456aa7f30f..00bc15d82f9 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.94 2013/03/07 09:03:16 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.95 2013/03/11 14:08:04 mpi Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -623,10 +623,6 @@ nd6_purge(struct ifnet *ifp) } } - /* cancel default outgoing interface setting */ - if (nd6_defifindex == ifp->if_index) - nd6_setdefaultiface(0); - if (!ip6_forwarding && ip6_accept_rtadv) { /* XXX: too restrictive? */ /* refresh default router list */ defrouter_select(); @@ -793,17 +789,6 @@ nd6_is_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp) } /* - * If the default router list is empty, all addresses are regarded - * as on-link, and thus, as a neighbor. - * XXX: we restrict the condition to hosts, because routers usually do - * not have the "default router list". - */ - if (!ip6_forwarding && TAILQ_EMPTY(&nd_defrouter) && - nd6_defifindex == ifp->if_index) { - return (1); - } - - /* * Even if the address matches none of our addresses, it might be * in the neighbor cache. */ @@ -1268,7 +1253,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) struct in6_oprlist *oprl = (struct in6_oprlist *)data; struct in6_ndireq *ndi = (struct in6_ndireq *)data; struct in6_nbrinfo *nbi = (struct in6_nbrinfo *)data; - struct in6_ndifreq *ndif = (struct in6_ndifreq *)data; struct nd_defrouter *dr; struct nd_prefix *pr; struct rtentry *rt; @@ -1471,12 +1455,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) break; } - case SIOCGDEFIFACE_IN6: /* XXX: should be implemented as a sysctl? */ - ndif->ifindex = nd6_defifindex; - break; - case SIOCSDEFIFACE_IN6: /* XXX: should be implemented as a sysctl? */ - return (nd6_setdefaultiface(ndif->ifindex)); - break; } return (error); } diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index e79c8663e81..310347d3c95 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.h,v 1.29 2012/02/14 18:05:41 sthen Exp $ */ +/* $OpenBSD: nd6.h,v 1.30 2013/03/11 14:08:04 mpi Exp $ */ /* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */ /* @@ -328,9 +328,6 @@ extern int nd6_debug; extern struct timeout nd6_timer_ch; -/* nd6_rtr.c */ -extern int nd6_defifindex; - union nd_opts { struct nd_opt_hdr *nd_opt_array[9]; struct { @@ -416,7 +413,6 @@ 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); void rt6_flush(struct in6_addr *, struct ifnet *); -int nd6_setdefaultiface(int); #endif /* _KERNEL */ diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index a1fd026c7db..b59280c6797 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.67 2013/03/07 09:40:19 mpi Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.68 2013/03/11 14:08:04 mpi Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -81,9 +81,6 @@ void nd6_addr_add(void *, void *); extern int nd6_recalc_reachtm_interval; -static struct ifnet *nd6_defifp; -int nd6_defifindex; - /* * Receive Router Solicitation Message - just for routers. * Router solicitation/advertisement is mostly managed by userland program @@ -2009,24 +2006,3 @@ rt6_deleteroute(struct radix_node *rn, void *arg, u_int id) return (rtrequest1(RTM_DELETE, &info, RTP_ANY, NULL, id)); #undef SIN6 } - -int -nd6_setdefaultiface(int ifindex) -{ - int error = 0; - - if (ifindex < 0 || if_indexlim <= ifindex) - return (EINVAL); - if (ifindex != 0 && !ifindex2ifnet[ifindex]) - return (EINVAL); - - if (nd6_defifindex != ifindex) { - nd6_defifindex = ifindex; - if (nd6_defifindex > 0) { - nd6_defifp = ifindex2ifnet[nd6_defifindex]; - } else - nd6_defifp = NULL; - } - - return (error); -} |