--- linux/net/ipv4/icmp.c~ Thu Jun 21 06:00:55 2001 +++ linux/net/ipv4/icmp.c Mon Jul 30 13:32:56 2001 @@ -16,6 +16,9 @@ * Other than that this module is a complete rewrite. * * Fixes: + * Clemens Fruhwirth : Fix incorrect limiting in xrlim_allow + * for a packet succedding a packet with + * timeout==0. * Mike Shaver : RFC1122 checks. * Alan Cox : Multicast ping reply as self. * Alan Cox : Fix atomicity lockup in ip_build_xmit @@ -223,11 +226,6 @@ * Note that the same dst_entry fields are modified by functions in * route.c too, but these work for packet destinations while xrlim_allow * works for icmp destinations. This means the rate limiting information - * for one "ip object" is shared. - * - * Note that the same dst_entry fields are modified by functions in - * route.c too, but these work for packet destinations while xrlim_allow - * works for icmp destinations. This means the rate limiting information * for one "ip object" is shared - and these ICMPs are twice limited: * by source and by destination. * @@ -241,9 +239,12 @@ { unsigned long now; + if (0 == timeout) return 1; + now = jiffies; dst->rate_tokens += now - dst->rate_last; dst->rate_last = now; + if (dst->rate_tokens > XRLIM_BURST_FACTOR*timeout) dst->rate_tokens = XRLIM_BURST_FACTOR*timeout; if (dst->rate_tokens >= timeout) {