summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorgnezdo <gnezdo@cvs.openbsd.org>2020-11-16 06:44:40 +0000
committergnezdo <gnezdo@cvs.openbsd.org>2020-11-16 06:44:40 +0000
commit24495208247b2f19bb972d8cd40ff41230737267 (patch)
tree7e105da95ad33396e96a2797335422f1c3fa51c6 /sys/netinet
parenta124ca2a8559146862388c395ea9011193c3797f (diff)
Replace sysctl_rdint with sysctl_bounded_args entries in net.inet*
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_input.c12
-rw-r--r--sys/netinet/tcp_usrreq.c7
2 files changed, 11 insertions, 8 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 130f7a48a09..8258faf7477 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.351 2020/08/22 17:55:30 gnezdo Exp $ */
+/* $OpenBSD: ip_input.c,v 1.352 2020/11/16 06:44:38 gnezdo Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -107,7 +107,14 @@ LIST_HEAD(, ipq) ipq;
int ip_maxqueue = 300;
int ip_frags = 0;
+#ifdef MROUTING
+extern int ip_mrtproto;
+#endif
+
const struct sysctl_bounded_args ipctl_vars[] = {
+#ifdef MROUTING
+ { IPCTL_MRTPROTO, &ip_mrtproto, 1, 0 },
+#endif
{ IPCTL_FORWARDING, &ipforwarding, 0, 1 },
{ IPCTL_SENDREDIRECTS, &ipsendredirects, 0, 1 },
{ IPCTL_DEFTTL, &ip_defttl, 0, 255 },
@@ -1562,7 +1569,6 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
{
int error;
#ifdef MROUTING
- extern int ip_mrtproto;
extern struct mrtstat mrtstat;
#endif
@@ -1636,8 +1642,6 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
case IPCTL_MRTSTATS:
return (sysctl_rdstruct(oldp, oldlenp, newp,
&mrtstat, sizeof(mrtstat)));
- case IPCTL_MRTPROTO:
- return (sysctl_rdint(oldp, oldlenp, newp, ip_mrtproto));
case IPCTL_MRTMFC:
if (newp)
return (EPERM);
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 5057a6af44e..64327536ee5 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.177 2020/11/02 04:29:23 gnezdo Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.178 2020/11/16 06:44:38 gnezdo Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -110,7 +110,9 @@ u_int tcp_sendspace = TCP_SENDSPACE;
u_int tcp_recvspace = TCP_RECVSPACE;
u_int tcp_autorcvbuf_inc = 16 * 1024;
+static int pr_slowhz = PR_SLOWHZ;
const struct sysctl_bounded_args tcpctl_vars[] = {
+ { TCPCTL_SLOWHZ, &pr_slowhz, 1, 0 },
{ TCPCTL_RFC1323, &tcp_do_rfc1323, 0, 1 },
{ TCPCTL_KEEPINITTIME, &tcptv_keep_init, 1, 3 * TCPTV_KEEP_INIT },
{ TCPCTL_KEEPIDLE, &tcp_keepidle, 1, 5 * TCPTV_KEEP_IDLE },
@@ -997,9 +999,6 @@ tcp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (ENOTDIR);
switch (name[0]) {
- case TCPCTL_SLOWHZ:
- return (sysctl_rdint(oldp, oldlenp, newp, PR_SLOWHZ));
-
case TCPCTL_BADDYNAMIC:
NET_LOCK();
error = sysctl_struct(oldp, oldlenp, newp, newlen,