diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2001-02-11 07:39:51 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2001-02-11 07:39:51 +0000 |
commit | 0f9088da5625e8088bdbd7b3587fdadb265b1482 (patch) | |
tree | 05dfca28095c82a06dee66b4ae5d1541036a93af /sys/netinet/ip_icmp.c | |
parent | cc52eb42bff57e11d166025d0d19cae8152a462d (diff) | |
download | FreeBSD-src-0f9088da5625e8088bdbd7b3587fdadb265b1482.zip FreeBSD-src-0f9088da5625e8088bdbd7b3587fdadb265b1482.tar.gz |
Clean up RST ratelimiting. Previously, ratelimiting occured before tests
were performed to determine if the received packet should be reset. This
created erroneous ratelimiting and false alarms in some cases. The code
has now been reorganized so that the checks for validity come before
the call to badport_bandlim. Additionally, a few changes in the symbolic
names of the bandlim types have been made, as well as a clarification of
exactly which type each RST case falls under.
Submitted by: Mike Silbersack <silby@silby.com>
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r-- | sys/netinet/ip_icmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 98758ca..6a277aa 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -464,7 +464,7 @@ icmp_input(m, off, proto) break; } icp->icmp_type = ICMP_ECHOREPLY; - if (badport_bandlim(BANDLIM_ECHO) < 0) + if (badport_bandlim(BANDLIM_ICMP_ECHO) < 0) goto freeit; else goto reflect; @@ -482,7 +482,7 @@ icmp_input(m, off, proto) icp->icmp_type = ICMP_TSTAMPREPLY; icp->icmp_rtime = iptime(); icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */ - if (badport_bandlim(BANDLIM_TSTAMP) < 0) + if (badport_bandlim(BANDLIM_ICMP_TSTAMP) < 0) goto freeit; else goto reflect; @@ -847,10 +847,10 @@ badport_bandlim(int which) int dticks; const char *bandlimittype[] = { "Limiting icmp unreach response", - "Limiting closed port RST response", - "Limiting open port RST response", "Limiting icmp ping response", - "Limiting icmp tstamp response" + "Limiting icmp tstamp response", + "Limiting closed port RST response", + "Limiting open port RST response" }; /* |