Subject: kern/26368: Support IPv6 address changes with pfil(9)
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 07/19/2004 15:59:45
>Number:         26368
>Category:       kern
>Synopsis:       Support IPv6 address changes with pfil(9)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 19 14:00:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Peter Postma
>Release:        NetBSD 2.0G
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 2.0G NetBSD 2.0G (mercury) #16: Mon Jul 19 03:41:25 CEST 2004 peter@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
Patch below adds support for IPv6 address changes with pfil(9).
>How-To-Repeat:
>Fix:
Index: in6.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/in6.c,v
retrieving revision 1.89
diff -u -r1.89 in6.c
--- in6.c	16 Jun 2004 03:17:26 -0000	1.89
+++ in6.c	19 Jul 2004 13:57:47 -0000
@@ -97,6 +97,10 @@
 
 #include <net/net_osdep.h>
 
+#ifdef PFIL_HOOKS
+#include <net/pfil.h>
+#endif
+
 MALLOC_DEFINE(M_IP6OPT, "ip6_options", "IPv6 options");
 
 /* enable backward compatibility code for obsoleted ioctls */
@@ -737,6 +741,11 @@
 		 */
 		pfxlist_onlink_check();
 
+#ifdef PFIL_HOOKS
+		(void)pfil_run_hooks(&if_pfil, (struct mbuf **)SIOCAIFADDR_IN6,
+		    ifp, PFIL_IFADDR);
+#endif
+
 		break;
 	}
 
@@ -777,6 +786,10 @@
 		in6_purgeaddr(&ia->ia_ifa);
 		if (pr && purgeprefix)
 			prelist_remove(pr);
+#ifdef PFIL_HOOKS
+		(void)pfil_run_hooks(&if_pfil, (struct mbuf **)SIOCDIFADDR_IN6,
+		    ifp, PFIL_IFADDR);
+#endif
 		break;
 	}
 
>Release-Note:
>Audit-Trail:
>Unformatted: