diff options
author | gnezdo <gnezdo@cvs.openbsd.org> | 2020-08-17 16:25:35 +0000 |
---|---|---|
committer | gnezdo <gnezdo@cvs.openbsd.org> | 2020-08-17 16:25:35 +0000 |
commit | ed830fdd1da3c345eb2a5665398dc9113c79e878 (patch) | |
tree | d162c4fe1fa0c63032bd237f8c82c095fcf473c2 /sys/netinet | |
parent | b5c2db7b597a2baab8a2553cf30ba6faae3b5d6c (diff) |
Simplify igmp_sysctl to directly return error in default case
This replaces a piece of observationally identical code which was much
more complicated.
ok mpi@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/igmp.c | 12 | ||||
-rw-r--r-- | sys/netinet/igmp_var.h | 6 |
2 files changed, 3 insertions, 15 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 5ea33fab441..017713c3401 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: igmp.c,v 1.75 2020/08/01 23:41:55 gnezdo Exp $ */ +/* $OpenBSD: igmp.c,v 1.76 2020/08/17 16:25:34 gnezdo Exp $ */ /* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */ /* @@ -96,8 +96,6 @@ #define IP_MULTICASTOPTS 0 -int *igmpctl_vars[IGMPCTL_MAXID] = IGMPCTL_VARS; - int igmp_timers_are_running; static LIST_HEAD(, router_info) rti_head; static struct mbuf *router_alert; @@ -683,8 +681,6 @@ int igmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { - int error; - /* All sysctl names at this level are terminal. */ if (namelen != 1) return (ENOTDIR); @@ -695,11 +691,7 @@ igmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, return (EPERM); return (igmp_sysctl_igmpstat(oldp, oldlenp, newp)); default: - NET_LOCK(); - error = sysctl_int_arr(igmpctl_vars, nitems(igmpctl_vars), name, - namelen, oldp, oldlenp, newp, newlen); - NET_UNLOCK(); - return (error); + return (EOPNOTSUPP); } /* NOTREACHED */ } diff --git a/sys/netinet/igmp_var.h b/sys/netinet/igmp_var.h index 15c85d10d6a..920a7ba7053 100644 --- a/sys/netinet/igmp_var.h +++ b/sys/netinet/igmp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: igmp_var.h,v 1.13 2017/04/14 20:46:31 bluhm Exp $ */ +/* $OpenBSD: igmp_var.h,v 1.14 2020/08/17 16:25:34 gnezdo Exp $ */ /* $NetBSD: igmp_var.h,v 1.9 1996/02/13 23:41:31 christos Exp $ */ /* @@ -73,10 +73,6 @@ struct igmpstat { { "stats", CTLTYPE_STRUCT } \ } -#define IGMPCTL_VARS { \ - NULL \ -} - #ifdef _KERNEL #include <sys/percpu.h> |