Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Don't rate-limit ICMP errors from packets we sen...



details:   https://anonhg.NetBSD.org/src/rev/adbf2fba7464
branches:  trunk
changeset: 494105:adbf2fba7464
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sat Jul 01 21:46:40 2000 +0000

description:
Don't rate-limit ICMP errors from packets we send to ourselves.
The dns resolver depends on reliably receiving errors to allow it to
quickly detect a dead local nameserver.

diffstat:

 sys/netinet/ip_icmp.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 6c9acc03b3c3 -r adbf2fba7464 sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c     Sat Jul 01 21:41:41 2000 +0000
+++ b/sys/netinet/ip_icmp.c     Sat Jul 01 21:46:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_icmp.c,v 1.48 2000/06/28 03:01:16 mrg Exp $ */
+/*     $NetBSD: ip_icmp.c,v 1.49 2000/07/01 21:46:40 sommerfeld Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1002,13 +1002,21 @@
  */
 static int
 icmp_ratelimit(dst, type, code)
-       const struct in_addr *dst;      /* not used at this moment */
+       const struct in_addr *dst;
        const int type;                 /* not used at this moment */
        const int code;                 /* not used at this moment */
 {
        static struct timeval icmperrratelim_last;
+       struct in_ifaddr *ia;
 
        /*
+        * Don't rate-limit if it's for us!  
+        */
+       INADDR_TO_IA(*dst, ia);
+       if (ia != NULL)
+               return 0;
+       
+       /*
         * ratecheck() returns true if it is okay to send.  We return
         * true if it is not okay to send.
         */



Home | Main Index | Thread Index | Old Index