From: mvs Date: Tue, 20 Aug 2024 07:46:27 +0000 (+0000) Subject: Unlock igmp_sysctl(), pfsync_sysctl() and rip6_sysctl(). Each of them is X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=572e76f61b959e880cae926d862d7e8a60f1019b;p=openbsd Unlock igmp_sysctl(), pfsync_sysctl() and rip6_sysctl(). Each of them is the only IGMPCTL_STATS, PFSYNCCTL_STATS and RIPV6CTL_STATS per-CPU counters. sysctl_rdstruct() has "newp != NULL" check within and also returns EPERM, no need for redundant check in igmp_sysctl(). ok bluhm --- diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 600731ae36a..dec2c734921 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: igmp.c,v 1.84 2024/08/12 11:25:27 bluhm Exp $ */ +/* $OpenBSD: igmp.c,v 1.85 2024/08/20 07:46:27 mvs Exp $ */ /* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */ /* @@ -687,8 +687,6 @@ igmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, switch (name[0]) { case IGMPCTL_STATS: - if (newp != NULL) - return (EPERM); return (igmp_sysctl_igmpstat(oldp, oldlenp, newp)); default: return (EOPNOTSUPP); diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index a279775fde9..558123df7ef 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_proto.c,v 1.108 2024/08/16 09:20:35 mvs Exp $ */ +/* $OpenBSD: in_proto.c,v 1.109 2024/08/20 07:46:27 mvs Exp $ */ /* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */ /* @@ -270,7 +270,7 @@ const struct protosw inetsw[] = { .pr_type = SOCK_RAW, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_IGMP, - .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPSOCKET, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPSOCKET|PR_MPSYSCTL, .pr_input = igmp_input, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs, @@ -342,7 +342,7 @@ const struct protosw inetsw[] = { .pr_type = SOCK_RAW, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_PFSYNC, - .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPSOCKET, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPSOCKET|PR_MPSYSCTL, .pr_input = pfsync_input4, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs, diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index d35cff479b6..ba686c942de 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_proto.c,v 1.118 2024/08/16 09:20:35 mvs Exp $ */ +/* $OpenBSD: in6_proto.c,v 1.119 2024/08/20 07:46:27 mvs Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -158,7 +158,7 @@ const struct protosw inet6sw[] = { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, - .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPINPUT|PR_MPSOCKET, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPINPUT|PR_MPSOCKET|PR_MPSYSCTL, .pr_input = rip6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput,