summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_icmp.c
diff options
context:
space:
mode:
authordan <dan@FreeBSD.org>2000-05-22 16:12:28 +0000
committerdan <dan@FreeBSD.org>2000-05-22 16:12:28 +0000
commit4e9d022872d5646eddc9a6321d0b7ca70f61bb2b (patch)
tree52f3bc1da8b4ed9e997cf9ce7c7f5e9e4a62cd4c /sys/netinet/ip_icmp.c
parent187df3a0fbe92bcb52f715bf42ea38c9c2034c4b (diff)
downloadFreeBSD-src-4e9d022872d5646eddc9a6321d0b7ca70f61bb2b.zip
FreeBSD-src-4e9d022872d5646eddc9a6321d0b7ca70f61bb2b.tar.gz
sysctl'ize ICMP_BANDLIM and ICMP_BANDLIM_SUPPRESS_OUTPUT.
Suggested by: des/nbm
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r--sys/netinet/ip_icmp.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index a18f875..c4ea24c 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -91,23 +91,13 @@ static int log_redirect = 0;
SYSCTL_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW,
&log_redirect, 0, "");
-#ifdef ICMP_BANDLIM
-
-/*
- * ICMP error-response bandwidth limiting sysctl. If not enabled, sysctl
- * variable content is -1 and read-only.
- */
-
static int icmplim = 200;
SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW,
&icmplim, 0, "");
-#else
-static int icmplim = -1;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RD,
- &icmplim, 0, "");
-
-#endif
+static int icmplim_output = 1;
+SYSCTL_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW,
+ &icmplim_output, 0, "");
/*
* ICMP broadcast echo sysctl
@@ -800,7 +790,6 @@ ip_next_mtu(mtu, dir)
}
#endif
-#ifdef ICMP_BANDLIM
/*
* badport_bandlim() - check for ICMP bandwidth limit
@@ -842,13 +831,11 @@ badport_bandlim(int which)
*/
if ((unsigned int)dticks > hz) {
- if (lpackets[which] > icmplim) {
-#ifndef ICMP_BANDLIM_SUPPRESS_OUTPUT
+ if (lpackets[which] > icmplim && icmplim_output) {
printf("icmp-response bandwidth limit %d/%d pps\n",
lpackets[which],
icmplim
);
-#endif
}
lticks[which] = ticks;
lpackets[which] = 0;
@@ -864,6 +851,3 @@ badport_bandlim(int which)
return(0);
}
-#endif
-
-
OpenPOWER on IntegriCloud