diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-08-26 07:15:59 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-08-26 07:15:59 +0000 |
commit | b477328ca09c223be9affa07da55bfb75e35a1d2 (patch) | |
tree | 845ff7f81bd03da9336232cf579983d658731dcd /sys/netinet6 | |
parent | bc881ef28cbdd9532aefa472a14fe3f0f860d456 (diff) |
No one uses the obsolete IPv6 ioctls SIOCGDRLST_IN6, SIOCGPRLST_IN6,
OSIOCGIFINFO_IN6 anymore. Remove them together with the structs
in6_drlist, in6_oprlist, in6_prlist, in6_ondireq and the kernel
implementation.
OK mikeb@ henning@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6.c | 5 | ||||
-rw-r--r-- | sys/netinet6/in6_var.h | 7 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 102 | ||||
-rw-r--r-- | sys/netinet6/nd6.h | 66 |
4 files changed, 5 insertions, 175 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 658579549fd..a2ed35801ca 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.117 2013/08/13 05:52:25 guenther Exp $ */ +/* $OpenBSD: in6.c,v 1.118 2013/08/26 07:15:58 bluhm Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -361,10 +361,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, if (!privileged) return (EPERM); /* FALLTHROUGH */ - case OSIOCGIFINFO_IN6: case SIOCGIFINFO_IN6: - case SIOCGDRLST_IN6: - case SIOCGPRLST_IN6: case SIOCGNBRINFO_IN6: return (nd6_ioctl(cmd, data, ifp)); } diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 5e316791fbd..3245b49ba01 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_var.h,v 1.40 2013/06/17 18:02:24 bluhm Exp $ */ +/* $OpenBSD: in6_var.h,v 1.41 2013/08/26 07:15:58 bluhm Exp $ */ /* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */ /* @@ -400,11 +400,6 @@ struct in6_rrenumreq { #define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) -#define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist) -#define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_prlist) -#ifdef _KERNEL -#define OSIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq) -#endif #define SIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ndireq) #define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq) #define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 628c4149968..5eeabdc4f99 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.100 2013/08/13 05:52:25 guenther Exp $ */ +/* $OpenBSD: nd6.c,v 1.101 2013/08/26 07:15:58 bluhm Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -1238,111 +1238,13 @@ nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) int nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) { - struct in6_drlist *drl = (struct in6_drlist *)data; - 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 nd_defrouter *dr; - struct nd_prefix *pr; struct rtentry *rt; - int i = 0, error = 0; + int error = 0; int s; switch (cmd) { - case SIOCGDRLST_IN6: - /* - * obsolete API, use sysctl under net.inet6.icmp6 - */ - bzero(drl, sizeof(*drl)); - s = splsoftnet(); - TAILQ_FOREACH(dr, &nd_defrouter, dr_entry) { - if (i >= DRLSTSIZ) - break; - drl->defrouter[i].rtaddr = dr->rtaddr; - if (IN6_IS_ADDR_LINKLOCAL(&drl->defrouter[i].rtaddr)) { - /* XXX: need to this hack for KAME stack */ - drl->defrouter[i].rtaddr.s6_addr16[1] = 0; - } else - log(LOG_ERR, - "default router list contains a " - "non-linklocal address(%s)\n", - ip6_sprintf(&drl->defrouter[i].rtaddr)); - - drl->defrouter[i].flags = dr->flags; - drl->defrouter[i].rtlifetime = dr->rtlifetime; - drl->defrouter[i].expire = dr->expire; - drl->defrouter[i].if_index = dr->ifp->if_index; - i++; - } - splx(s); - break; - case SIOCGPRLST_IN6: - /* - * obsolete API, use sysctl under net.inet6.icmp6 - * - * XXX the structure in6_prlist was changed in backward- - * incompatible manner. in6_oprlist is used for SIOCGPRLST_IN6, - * in6_prlist is used for nd6_sysctl() - fill_prlist(). - */ - /* - * XXX meaning of fields, especially "raflags", is very - * different between RA prefix list and RR/static prefix list. - * how about separating ioctls into two? - */ - bzero(oprl, sizeof(*oprl)); - s = splsoftnet(); - LIST_FOREACH(pr, &nd_prefix, ndpr_entry) { - struct nd_pfxrouter *pfr; - int j; - - if (i >= PRLSTSIZ) - break; - oprl->prefix[i].prefix = pr->ndpr_prefix.sin6_addr; - oprl->prefix[i].raflags = pr->ndpr_raf; - oprl->prefix[i].prefixlen = pr->ndpr_plen; - oprl->prefix[i].vltime = pr->ndpr_vltime; - oprl->prefix[i].pltime = pr->ndpr_pltime; - oprl->prefix[i].if_index = pr->ndpr_ifp->if_index; - oprl->prefix[i].expire = pr->ndpr_expire; - - j = 0; - LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { - if (j < DRLSTSIZ) { -#define RTRADDR oprl->prefix[i].advrtr[j] - RTRADDR = pfr->router->rtaddr; - if (IN6_IS_ADDR_LINKLOCAL(&RTRADDR)) { - /* XXX: hack for KAME */ - RTRADDR.s6_addr16[1] = 0; - } else - log(LOG_ERR, - "a router(%s) advertises " - "a prefix with " - "non-link local address\n", - ip6_sprintf(&RTRADDR)); -#undef RTRADDR - } - j++; - } - oprl->prefix[i].advrtrs = j; - oprl->prefix[i].origin = PR_ORIG_RA; - - i++; - } - splx(s); - - break; - case OSIOCGIFINFO_IN6: - /* XXX: old ndp(8) assumes a positive value for linkmtu. */ - bzero(&ndi->ndi, sizeof(ndi->ndi)); - ndi->ndi.linkmtu = IN6_LINKMTU(ifp); - ndi->ndi.maxmtu = ND_IFINFO(ifp)->maxmtu; - ndi->ndi.basereachable = ND_IFINFO(ifp)->basereachable; - ndi->ndi.reachable = ND_IFINFO(ifp)->reachable; - ndi->ndi.retrans = ND_IFINFO(ifp)->retrans; - ndi->ndi.flags = ND_IFINFO(ifp)->flags; - ndi->ndi.recalctm = ND_IFINFO(ifp)->recalctm; - ndi->ndi.chlim = ND_IFINFO(ifp)->chlim; - break; case SIOCGIFINFO_IN6: ndi->ndi = *ND_IFINFO(ifp); break; diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 02a74df474a..66950946c9a 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.h,v 1.32 2013/08/11 22:13:32 bluhm Exp $ */ +/* $OpenBSD: nd6.h,v 1.33 2013/08/26 07:15:58 bluhm Exp $ */ /* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */ /* @@ -113,19 +113,6 @@ struct in6_nbrinfo { int state; /* reachability state */ }; -#define DRLSTSIZ 10 -#define PRLSTSIZ 10 -struct in6_drlist { - char ifname[IFNAMSIZ]; - struct { - struct in6_addr rtaddr; - time_t expire; - u_short rtlifetime; - u_short if_index; - u_char flags; - } defrouter[DRLSTSIZ]; -}; - struct in6_defrouter { struct sockaddr_in6 rtaddr; time_t expire; @@ -134,40 +121,6 @@ struct in6_defrouter { u_char flags; }; -#ifdef _KERNEL -struct in6_oprlist { - char ifname[IFNAMSIZ]; - struct { - struct in6_addr prefix; - struct prf_ra raflags; - time_t expire; - u_int32_t vltime; - u_int32_t pltime; - u_short if_index; - u_short advrtrs; /* number of advertisement routers */ - u_char prefixlen; - u_char origin; - struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ - } prefix[PRLSTSIZ]; -}; -#endif - -struct in6_prlist { - char ifname[IFNAMSIZ]; - struct { - struct in6_addr prefix; - struct prf_ra raflags; - time_t expire; - u_int32_t vltime; - u_int32_t pltime; - u_short if_index; - u_short advrtrs; /* number of advertisement routers */ - u_char prefixlen; - u_char origin; - struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ - } prefix[PRLSTSIZ]; -}; - struct in6_prefix { struct sockaddr_in6 prefix; struct prf_ra raflags; @@ -183,23 +136,6 @@ struct in6_prefix { /* struct sockaddr_in6 advrtr[] */ }; -#ifdef _KERNEL -struct in6_ondireq { - char ifname[IFNAMSIZ]; - struct { - u_int32_t linkmtu; /* LinkMTU */ - u_int32_t maxmtu; /* Upper bound of LinkMTU */ - u_int32_t basereachable; /* BaseReachableTime */ - u_int32_t reachable; /* Reachable Time */ - u_int32_t retrans; /* Retrans Timer */ - u_int32_t flags; /* Flags */ - int recalctm; /* BaseReacable re-calculation timer */ - u_int8_t chlim; /* CurHopLimit */ - u_int8_t receivedra; - } ndi; -}; -#endif - struct in6_ndireq { char ifname[IFNAMSIZ]; struct nd_ifinfo ndi; |