diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6.c | 26 | ||||
-rw-r--r-- | sys/netinet6/in6_var.h | 35 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 21 |
3 files changed, 13 insertions, 69 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 89d2ecc705b..ddc0f9908b4 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.215 2017/10/24 09:30:15 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.216 2017/10/26 15:05:41 mpi Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -213,13 +213,6 @@ in6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) return (EOPNOTSUPP); switch (cmd) { - case SIOCSNDFLUSH_IN6: - case SIOCSPFXFLUSH_IN6: - case SIOCSRTRFLUSH_IN6: - case SIOCSIFINFO_FLAGS: - if (!privileged) - return (EPERM); - /* FALLTHROUGH */ case SIOCGIFINFO_IN6: case SIOCGNBRINFO_IN6: return (nd6_ioctl(cmd, data, ifp)); @@ -241,17 +234,11 @@ in6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) case SIOCAIFADDR_IN6: sa6 = &ifra->ifra_addr; break; - case SIOCGIFADDR_IN6: case SIOCGIFDSTADDR_IN6: case SIOCGIFNETMASK_IN6: case SIOCDIFADDR_IN6: case SIOCGIFAFLAG_IN6: - case SIOCSNDFLUSH_IN6: - case SIOCSPFXFLUSH_IN6: - case SIOCSRTRFLUSH_IN6: case SIOCGIFALIFETIME_IN6: - case SIOCGIFSTAT_IN6: - case SIOCGIFSTAT_ICMP6: sa6 = &ifr->ifr_addr; break; case SIOCSIFADDR: @@ -313,9 +300,6 @@ in6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) break; - case SIOCGIFADDR_IN6: - /* This interface is basically deprecated. use SIOCGIFCONF. */ - /* FALLTHROUGH */ case SIOCGIFAFLAG_IN6: case SIOCGIFNETMASK_IN6: case SIOCGIFDSTADDR_IN6: @@ -328,10 +312,6 @@ in6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) switch (cmd) { - case SIOCGIFADDR_IN6: - ifr->ifr_addr = ia6->ia_addr; - break; - case SIOCGIFDSTADDR_IN6: if ((ifp->if_flags & IFF_POINTOPOINT) == 0) return (EINVAL); @@ -350,10 +330,6 @@ in6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) ifr->ifr_ifru.ifru_flags6 = ia6->ia6_flags; break; - case SIOCGIFSTAT_IN6: - case SIOCGIFSTAT_ICMP6: - return (EOPNOTSUPP); - case SIOCGIFALIFETIME_IN6: ifr->ifr_ifru.ifru_lifetime = ia6->ia6_lifetime; if (ia6->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 2432502ca31..0bb9a50566b 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_var.h,v 1.70 2017/10/24 09:36:13 jsg Exp $ */ +/* $OpenBSD: in6_var.h,v 1.71 2017/10/26 15:05:41 mpi Exp $ */ /* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */ /* @@ -278,40 +278,21 @@ struct in6_aliasreq { #define IFA_IN6(x) (&((struct sockaddr_in6 *)((x)->ifa_addr))->sin6_addr) #define IFA_DSTIN6(x) (&((struct sockaddr_in6 *)((x)->ifa_dstaddr))->sin6_addr) -#ifdef _KERNEL -#define IN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ - (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ - (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ - (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ - (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) -#endif /* _KERNEL */ - -#define SIOCGIFADDR_IN6 _IOWR('i', 33, struct in6_ifreq) +#define SIOCDIFADDR_IN6 _IOW('i', 25, struct in6_ifreq) +#define SIOCAIFADDR_IN6 _IOW('i', 26, struct in6_aliasreq) #define SIOCGIFDSTADDR_IN6 _IOWR('i', 34, struct in6_ifreq) #define SIOCGIFNETMASK_IN6 _IOWR('i', 37, struct in6_ifreq) -#define SIOCDIFADDR_IN6 _IOW('i', 25, struct in6_ifreq) -#define SIOCAIFADDR_IN6 _IOW('i', 26, struct in6_aliasreq) - #define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) #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) -#define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq) -#define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) #define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) -#define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) -#define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) -#define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ - -#define SIOCGETSGCNT_IN6 _IOWR('u', 106, \ - struct sioc_sg_req6) /* get s,g pkt cnt */ -#define SIOCGETMIFCNT_IN6 _IOWR('u', 107, \ - struct sioc_mif_req6) /* get pkt cnt per if */ +#define SIOCGETSGCNT_IN6 _IOWR('u', 106, struct sioc_sg_req6) +#define SIOCGETMIFCNT_IN6 _IOWR('u', 107, struct sioc_mif_req6) #define IN6_IFF_ANYCAST 0x01 /* anycast address */ #define IN6_IFF_TENTATIVE 0x02 /* tentative address */ @@ -322,6 +303,12 @@ struct in6_aliasreq { #define IN6_IFF_PRIVACY 0x80 /* RFC 4941 temporary address */ #ifdef _KERNEL +#define IN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) + #define IN6_ARE_SCOPE_CMP(a,b) ((a)-(b)) #define IN6_ARE_SCOPE_EQUAL(a,b) ((a)==(b)) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 066cb5c5dfc..9a94a753a6d 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.219 2017/08/11 21:24:20 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.220 2017/10/26 15:05:41 mpi Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -996,25 +996,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) case SIOCGIFINFO_IN6: ndi->ndi = *ND_IFINFO(ifp); break; - case SIOCSIFINFO_FLAGS: - error = ENOTSUP; - break; - case SIOCSNDFLUSH_IN6: /* XXX: the ioctl name is confusing... */ - /* sync kernel routing table with the default router list */ - error = ENOTSUP; - break; - case SIOCSPFXFLUSH_IN6: - { - /* flush all the prefix advertised by routers */ - error = ENOTSUP; - break; - } - case SIOCSRTRFLUSH_IN6: - { - /* flush all the default routers */ - error = ENOTSUP; - break; - } case SIOCGNBRINFO_IN6: { struct llinfo_nd6 *ln; |