summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet6/in6.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/netinet6/in6.c')
-rw-r--r--freebsd/sys/netinet6/in6.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/freebsd/sys/netinet6/in6.c b/freebsd/sys/netinet6/in6.c
index f68f21f2..8dc4d29f 100644
--- a/freebsd/sys/netinet6/in6.c
+++ b/freebsd/sys/netinet6/in6.c
@@ -286,7 +286,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
return (mrt6_ioctl ? mrt6_ioctl(cmd, data) : EOPNOTSUPP);
}
- switch(cmd) {
+ switch (cmd) {
case SIOCAADDRCTL_POLICY:
case SIOCDADDRCTL_POLICY:
if (td != NULL) {
@@ -358,14 +358,10 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
if (error)
return (error);
}
- return (scope6_set(ifp,
- (struct scope6_id *)ifr->ifr_ifru.ifru_scope_id));
+ /* FALLTHROUGH */
case SIOCGSCOPE6:
- return (scope6_get(ifp,
- (struct scope6_id *)ifr->ifr_ifru.ifru_scope_id));
case SIOCGSCOPE6DEF:
- return (scope6_get_default((struct scope6_id *)
- ifr->ifr_ifru.ifru_scope_id));
+ return (scope6_ioctl(cmd, data, ifp));
}
switch (cmd) {
@@ -496,6 +492,13 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
if (error)
goto out;
}
+ /* FALLTHROUGH */
+ case SIOCGIFSTAT_IN6:
+ case SIOCGIFSTAT_ICMP6:
+ if (ifp->if_afdata[AF_INET6] == NULL) {
+ error = EPFNOSUPPORT;
+ goto out;
+ }
break;
case SIOCGIFADDR_IN6:
@@ -571,10 +574,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
break;
case SIOCGIFSTAT_IN6:
- if (ifp == NULL) {
- error = EINVAL;
- goto out;
- }
bzero(&ifr->ifr_ifru.ifru_stat,
sizeof(ifr->ifr_ifru.ifru_stat));
ifr->ifr_ifru.ifru_stat =
@@ -582,10 +581,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
break;
case SIOCGIFSTAT_ICMP6:
- if (ifp == NULL) {
- error = EINVAL;
- goto out;
- }
bzero(&ifr->ifr_ifru.ifru_icmp6stat,
sizeof(ifr->ifr_ifru.ifru_icmp6stat));
ifr->ifr_ifru.ifru_icmp6stat =
@@ -801,7 +796,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
}
default:
- if (ifp == NULL || ifp->if_ioctl == 0) {
+ if (ifp->if_ioctl == NULL) {
error = EOPNOTSUPP;
goto out;
}