diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2016-03-03 12:57:16 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2016-03-03 12:57:16 +0000 |
commit | 08a786c1c4b16ae26bca8a5e3c31b8ccfd7bf0cb (patch) | |
tree | e2c381806880023fa066cdc8fa00071f99a7edea /sys | |
parent | 4d3e6ec88c4619ef77df4b9aa14c92c2ab1d7479 (diff) |
Kill IPv6 prefix and router renumbering ioctls.
Router renumbering was never supported, prefix ioctls were deprecated
~15 years ago. Move some items in netinet6/nd6.h where they are still
used.
ok mikeb@ mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6.c | 15 | ||||
-rw-r--r-- | sys/netinet6/in6_var.h | 96 | ||||
-rw-r--r-- | sys/netinet6/nd6.h | 13 |
3 files changed, 14 insertions, 110 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index ee08a8d9eea..b3bff8a09a7 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.185 2016/03/03 12:51:51 jca Exp $ */ +/* $OpenBSD: in6.c,v 1.186 2016/03/03 12:57:15 jca Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -200,19 +200,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) } switch (cmd) { - case SIOCSIFPREFIX_IN6: - case SIOCDIFPREFIX_IN6: - case SIOCAIFPREFIX_IN6: - case SIOCCIFPREFIX_IN6: - case SIOCSGIFPREFIX_IN6: - case SIOCGIFPREFIX_IN6: - log(LOG_NOTICE, - "prefix ioctls are now invalidated. " - "please use ifconfig.\n"); - return (EOPNOTSUPP); - } - - switch (cmd) { case SIOCALIFADDR: case SIOCDLIFADDR: if (!privileged) diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index d31374b9b7e..3447750cb55 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_var.h,v 1.61 2016/03/03 12:51:51 jca Exp $ */ +/* $OpenBSD: in6_var.h,v 1.62 2016/03/03 12:57:15 jca Exp $ */ /* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */ /* @@ -269,91 +269,6 @@ struct in6_aliasreq { struct in6_addrlifetime ifra_lifetime; }; -/* prefix type macro */ -#define IN6_PREFIX_ND 1 -#define IN6_PREFIX_RR 2 - -/* - * prefix related flags passed between kernel(NDP related part) and - * userland command(ifconfig) and daemon(rtadvd). - */ -struct prf_ra { - u_int onlink : 1; - u_int autonomous : 1; - u_int router : 1; - u_int reserved : 5; -}; - -struct in6_prflags { - struct prf_ra prf_ra; - u_char prf_reserved1; - u_short prf_reserved2; - /* want to put this on 4byte offset */ - struct prf_rr { - u_int decrvalid : 1; - u_int decrprefd : 1; - u_int reserved : 6; - } prf_rr; - u_char prf_reserved3; - u_short prf_reserved4; -}; - -struct in6_prefixreq { - char ipr_name[IFNAMSIZ]; - u_char ipr_origin; - u_char ipr_plen; - u_int32_t ipr_vltime; - u_int32_t ipr_pltime; - struct in6_prflags ipr_flags; - struct sockaddr_in6 ipr_prefix; -}; - -#define PR_ORIG_RA 0 -#define PR_ORIG_RR 1 -#define PR_ORIG_STATIC 2 -#define PR_ORIG_KERNEL 3 - -#define ipr_raf_onlink ipr_flags.prf_ra.onlink -#define ipr_raf_auto ipr_flags.prf_ra.autonomous - -#define ipr_statef_onlink ipr_flags.prf_state.onlink - -#define ipr_rrf_decrvalid ipr_flags.prf_rr.decrvalid -#define ipr_rrf_decrprefd ipr_flags.prf_rr.decrprefd - -struct in6_rrenumreq { - char irr_name[IFNAMSIZ]; - u_char irr_origin; - u_char irr_m_len; /* match len for matchprefix */ - u_char irr_m_minlen; /* minlen for matching prefix */ - u_char irr_m_maxlen; /* maxlen for matching prefix */ - u_char irr_u_uselen; /* uselen for adding prefix */ - u_char irr_u_keeplen; /* keeplen from matching prefix */ - struct irr_raflagmask { - u_int onlink : 1; - u_int autonomous : 1; - u_int reserved : 6; - } irr_raflagmask; - u_int32_t irr_vltime; - u_int32_t irr_pltime; - struct in6_prflags irr_flags; - struct sockaddr_in6 irr_matchprefix; - struct sockaddr_in6 irr_useprefix; -}; - -#define irr_raf_mask_onlink irr_raflagmask.onlink -#define irr_raf_mask_auto irr_raflagmask.autonomous -#define irr_raf_mask_reserved irr_raflagmask.reserved - -#define irr_raf_onlink irr_flags.prf_ra.onlink -#define irr_raf_auto irr_flags.prf_ra.autonomous - -#define irr_statef_onlink irr_flags.prf_state.onlink - -#define irr_rrf irr_flags.prf_rr -#define irr_rrf_decrvalid irr_flags.prf_rr.decrvalid -#define irr_rrf_decrprefd irr_flags.prf_rr.decrprefd - /* * Given a pointer to an in6_ifaddr (ifaddr), * return a pointer to the addr as a sockaddr_in6 @@ -400,15 +315,6 @@ struct in6_rrenumreq { #define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ -#define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ -#define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */ -#define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */ -#define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */ -#define SIOCCIFPREFIX_IN6 _IOW('i', 104, \ - struct in6_rrenumreq) /* change */ -#define SIOCSGIFPREFIX_IN6 _IOW('i', 105, \ - struct in6_rrenumreq) /* set global */ - #define SIOCGETSGCNT_IN6 _IOWR('u', 106, \ struct sioc_sg_req6) /* get s,g pkt cnt */ #define SIOCGETMIFCNT_IN6 _IOWR('u', 107, \ diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 01ea34736dd..1f534d02d04 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.h,v 1.56 2015/12/18 10:55:51 tb Exp $ */ +/* $OpenBSD: nd6.h,v 1.57 2016/03/03 12:57:15 jca Exp $ */ /* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */ /* @@ -81,6 +81,13 @@ struct in6_defrouter { u_char flags; }; +struct prf_ra { + u_int onlink : 1; + u_int autonomous : 1; + u_int router : 1; + u_int reserved : 5; +}; + struct in6_prefix { struct sockaddr_in6 prefix; struct prf_ra raflags; @@ -93,6 +100,10 @@ struct in6_prefix { u_short advrtrs; /* number of advertisement routers */ u_char prefixlen; u_char origin; +#define PR_ORIG_RA 0 +#define PR_ORIG_RR 1 +#define PR_ORIG_STATIC 2 +#define PR_ORIG_KERNEL 3 /* struct sockaddr_in6 advrtr[] */ }; |