Subject: not ratelimiting looped-back icmp6 errors ..
To: None <itojun@iijlab.net>
From: Bill Sommerfeld <sommerfeld@netbsd.org>
List: tech-net
Date: 07/02/2000 11:06:07
This is what I came up with..

						- Bill

Index: icmp6.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/icmp6.c,v
retrieving revision 1.33
diff -u -r1.33 icmp6.c
--- icmp6.c	2000/06/13 17:31:37	1.33
+++ icmp6.c	2000/07/02 15:02:43
@@ -2476,12 +2476,22 @@
  */
 static int
 icmp6_ratelimit(dst, type, code)
-	const struct in6_addr *dst;	/* not used at this moment */
+	const struct in6_addr *dst;
 	const int type;			/* not used at this moment */
 	const int code;			/* not used at this moment */
 {
 	static struct timeval icmp6errratelim_last;
-
+	struct in6_ifaddr *ia;
+	
+	/*
+	 * Don't rate-limit messages intended for one of our addresses.
+	 */
+	for (ia = in6_ifaddr; ia; ia = ia->ia_next) {
+		if (IN6_ARE_ADDR_EQUAL(dst, &ia->ia_addr.sin6_addr) &&
+		    (ia->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY)) == 0)
+			return 0;
+	}
+	
 	/*
 	 * ratecheck() returns true if it is okay to send.  We return
 	 * true if it is not okay to send.