Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys nuke the following sysctl variables. "ppsratelimit" sho...
details: https://anonhg.NetBSD.org/src/rev/d69a2eb3fd2b
branches: trunk
changeset: 495443:d69a2eb3fd2b
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Jul 28 04:06:52 2000 +0000
description:
nuke the following sysctl variables. "ppsratelimit" should work better.
need to recompile sbin/sysctl after updating /usr/include.
net.inet.tcp.rstratelimit
net.inet.icmp.errratelimit
net.inet6.icmp6.errratelimit
diffstat:
sys/netinet/icmp6.h | 6 ++++--
sys/netinet/icmp_var.h | 6 ++++--
sys/netinet/in_proto.c | 4 +---
sys/netinet/ip_icmp.c | 33 ++-------------------------------
sys/netinet/tcp_input.c | 7 +------
sys/netinet/tcp_usrreq.c | 24 +-----------------------
sys/netinet/tcp_var.h | 7 ++++---
sys/netinet6/icmp6.c | 31 +------------------------------
sys/netinet6/in6_proto.c | 3 +--
9 files changed, 19 insertions(+), 102 deletions(-)
diffs (truncated from 327 to 300 lines):
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/icmp6.h
--- a/sys/netinet/icmp6.h Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/icmp6.h Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp6.h,v 1.10 2000/07/06 12:36:19 itojun Exp $ */
+/* $NetBSD: icmp6.h,v 1.11 2000/07/28 04:06:52 itojun Exp $ */
/* $KAME: icmp6.h,v 1.18 2000/07/03 02:51:08 itojun Exp $ */
/*
@@ -542,7 +542,9 @@
#define ICMPV6CTL_STATS 1
#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
+#if 0 /*obsoleted*/
#define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */
+#endif
#define ICMPV6CTL_ND6_PRUNE 6
#define ICMPV6CTL_ND6_DELAY 8
#define ICMPV6CTL_ND6_UMAXTRIES 9
@@ -560,7 +562,7 @@
{ "rediraccept", CTLTYPE_INT }, \
{ "redirtimeout", CTLTYPE_INT }, \
{ 0, 0 }, \
- { "errratelimit", CTLTYPE_INT }, \
+ { 0, 0 }, \
{ "nd6_prune", CTLTYPE_INT }, \
{ 0, 0 }, \
{ "nd6_delay", CTLTYPE_INT }, \
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/icmp_var.h
--- a/sys/netinet/icmp_var.h Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/icmp_var.h Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp_var.h,v 1.16 2000/07/10 09:31:29 itojun Exp $ */
+/* $NetBSD: icmp_var.h,v 1.17 2000/07/28 04:06:52 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -61,7 +61,9 @@
* Names for ICMP sysctl objects
*/
#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
+#if 0 /*obsoleted*/
#define ICMPCTL_ERRRATELIMIT 2 /* error rate limit */
+#endif
#define ICMPCTL_RETURNDATABYTES 3 /* # of bytes to include in errors */
#define ICMPCTL_ERRPPSLIMIT 4 /* ICMP error pps limitation */
#define ICMPCTL_MAXID 5
@@ -69,7 +71,7 @@
#define ICMPCTL_NAMES { \
{ 0, 0 }, \
{ "maskrepl", CTLTYPE_INT }, \
- { "errratelimit", CTLTYPE_INT }, \
+ { 0, 0 }, \
{ "returndatabytes", CTLTYPE_INT }, \
{ "errppslimit", CTLTYPE_INT }, \
}
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/in_proto.c
--- a/sys/netinet/in_proto.c Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/in_proto.c Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_proto.c,v 1.41 2000/07/27 11:34:06 itojun Exp $ */
+/* $NetBSD: in_proto.c,v 1.42 2000/07/28 04:06:52 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -301,8 +301,6 @@
struct syn_cache_head tcp_syn_cache[TCP_SYN_HASH_SIZE];
int tcp_syn_cache_interval = 1; /* runs timer twice a second */
-struct timeval tcp_rst_ratelim = { 0, 0 }; /* no ratelimit */
int tcp_rst_ppslim = 100; /* 100pps */
-struct timeval icmperrratelim = { 0, 0 }; /* no ratelimit */
int icmperrppslim = 100; /* 100pps */
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/ip_icmp.c Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_icmp.c,v 1.53 2000/07/27 11:36:14 itojun Exp $ */
+/* $NetBSD: ip_icmp.c,v 1.54 2000/07/28 04:06:53 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -154,7 +154,6 @@
/*static*/ int ip_next_mtu __P((int, int));
#endif
-extern struct timeval icmperrratelim;
extern int icmperrppslim;
static int icmperrpps_count = 0;
static struct timeval icmperrppslim_last;
@@ -834,7 +833,7 @@
void *newp;
size_t newlen;
{
- int arg, error, s;
+ int arg, error;
/* All sysctl names at this level are terminal. */
if (namelen != 1)
@@ -845,24 +844,6 @@
case ICMPCTL_MASKREPL:
error = sysctl_int(oldp, oldlenp, newp, newlen, &icmpmaskrepl);
break;
- case ICMPCTL_ERRRATELIMIT:
- /*
- * The sysctl specifies the rate in usec-between-icmp,
- * so we must convert from/to a timeval.
- */
- arg = (icmperrratelim.tv_sec * 1000000) +
- icmperrratelim.tv_usec;
- error = sysctl_int(oldp, oldlenp, newp, newlen, &arg);
- if (error)
- break;
- if (arg >= 0) {
- s = splsoftnet();
- icmperrratelim.tv_sec = arg / 1000000;
- icmperrratelim.tv_usec = arg % 1000000;
- splx(s);
- } else
- error = EINVAL;
- break;
case ICMPCTL_RETURNDATABYTES:
arg = icmpreturndatabytes;
error = sysctl_int(oldp, oldlenp, newp, newlen, &arg);
@@ -1041,7 +1022,6 @@
const int type; /* not used at this moment */
const int code; /* not used at this moment */
{
- static struct timeval icmperrratelim_last;
/* PPS limit */
if (!ppsratecheck(&icmperrppslim_last, &icmperrpps_count,
@@ -1050,15 +1030,6 @@
return 1;
}
- /*
- * ratecheck() returns true if it is okay to send. We return
- * true if it is not okay to send.
- */
- if (!ratecheck(&icmperrratelim_last, &icmperrratelim)) {
- /* The packet is subject to rate limit */
- return 1;
- }
-
/*okay to send*/
return 0;
}
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/tcp_input.c Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.116 2000/07/27 11:34:06 itojun Exp $ */
+/* $NetBSD: tcp_input.c,v 1.117 2000/07/28 04:06:53 itojun Exp $ */
/*
%%% portions-copyright-nrl-95
@@ -190,7 +190,6 @@
int tcprexmtthresh = 3;
int tcp_log_refused;
-struct timeval tcp_rst_ratelim_last;
static int tcp_rst_ppslim_count = 0;
static struct timeval tcp_rst_ppslim_last;
@@ -2150,10 +2149,6 @@
/* XXX stat */
goto drop;
}
- if (ratecheck(&tcp_rst_ratelim_last, &tcp_rst_ratelim) == 0) {
- /* XXX stat */
- goto drop;
- }
/* ...fall into dropwithreset... */
dropwithreset:
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/tcp_usrreq.c Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.52 2000/06/28 03:01:17 mrg Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.53 2000/07/28 04:06:54 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -901,28 +901,6 @@
if (namelen != 1)
return (ENOTDIR);
- /*
- * The sysctl specifies usec-between-RST, so we must
- * convert from/to a timeval.
- */
- if (name[0] == TCPCTL_RSTRATELIMIT) {
- int rate_usec, error, s;
-
- rate_usec = (tcp_rst_ratelim.tv_sec * 1000000) +
- tcp_rst_ratelim.tv_usec;
- error = sysctl_int(oldp, oldlenp, newp, newlen, &rate_usec);
- if (error)
- return (error);
- if (rate_usec < 0)
- return (EINVAL);
- s = splsoftnet();
- tcp_rst_ratelim.tv_sec = rate_usec / 1000000;
- tcp_rst_ratelim.tv_usec = rate_usec % 1000000;
- splx(s);
-
- return (0);
- }
-
if (name[0] < sizeof(tcp_ctlvars)/sizeof(tcp_ctlvars[0])
&& tcp_ctlvars[name[0]].valid) {
if (tcp_ctlvars[name[0]].rdonly)
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet/tcp_var.h
--- a/sys/netinet/tcp_var.h Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet/tcp_var.h Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_var.h,v 1.73 2000/07/27 11:34:07 itojun Exp $ */
+/* $NetBSD: tcp_var.h,v 1.74 2000/07/28 04:06:55 itojun Exp $ */
/*
%%% portions-copyright-nrl-98
@@ -534,7 +534,9 @@
#define TCPCTL_SLOWHZ 20 /* PR_SLOWHZ (read-only) */
#define TCPCTL_NEWRENO 21 /* NewReno Congestion Control */
#define TCPCTL_LOG_REFUSED 22 /* Log refused connections */
+#if 0 /*obsoleted*/
#define TCPCTL_RSTRATELIMIT 23 /* RST rate limit */
+#endif
#define TCPCTL_RSTPPSLIMIT 24 /* RST pps limit */
#define TCPCTL_MAXID 25
@@ -562,7 +564,7 @@
{ "slowhz", CTLTYPE_INT }, \
{ "newreno", CTLTYPE_INT }, \
{ "log_refused",CTLTYPE_INT }, \
- { "rstratelimit", CTLTYPE_INT }, \
+ { 0, 0 }, \
{ "rstppslimit", CTLTYPE_INT }, \
}
@@ -590,7 +592,6 @@
extern int tcp_syn_cache_interval; /* compressed state timer */
extern int tcp_log_refused; /* log refused connections */
-extern struct timeval tcp_rst_ratelim;
extern int tcp_rst_ppslim;
extern int tcp_syn_cache_size;
diff -r ad8f98083512 -r d69a2eb3fd2b sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c Fri Jul 28 03:08:52 2000 +0000
+++ b/sys/netinet6/icmp6.c Fri Jul 28 04:06:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp6.c,v 1.37 2000/07/09 06:44:58 itojun Exp $ */
+/* $NetBSD: icmp6.c,v 1.38 2000/07/28 04:06:58 itojun Exp $ */
/* $KAME: icmp6.c,v 1.120 2000/07/06 11:47:20 itojun Exp $ */
/*
@@ -111,8 +111,6 @@
struct icmp6stat icmp6stat;
extern struct in6pcb rawin6pcb;
-extern struct timeval icmp6errratelim;
-static struct timeval icmp6errratelim_last;
extern int icmp6errppslim;
static int icmp6errpps_count = 0;
static struct timeval icmp6errppslim_last;
@@ -2562,11 +2560,6 @@
ret++;
}
- if (!ratecheck(&icmp6errratelim_last, &icmp6errratelim)) {
- /* The packet is subject to rate limit */
- ret++;
- }
-
return ret;
}
@@ -2654,28 +2647,6 @@
case ICMPV6CTL_STATS:
return sysctl_rdstruct(oldp, oldlenp, newp,
&icmp6stat, sizeof(icmp6stat));
- case ICMPV6CTL_ERRRATELIMIT:
- {
- int rate_usec, error, s;
-
- /*
- * The sysctl specifies the rate in usec-between-icmp,
- * so we must convert from/to a timeval.
- */
- rate_usec = (icmp6errratelim.tv_sec * 1000000) +
- icmp6errratelim.tv_usec;
- error = sysctl_int(oldp, oldlenp, newp, newlen, &rate_usec);
- if (error)
- return (error);
- if (rate_usec < 0)
- return (EINVAL);
Home |
Main Index |
Thread Index |
Old Index