Module Name:    src
Committed By:   pooka
Date:           Wed Mar  3 01:13:26 UTC 2010

Modified Files:
        src/sys/netkey: key.c

Log Message:
Remove #ifdef KERNFS by using weak symbols.  Notably, this approach
won't work when kernfs is a module.  But then again, kernfs as a
module (i.e. current situation) doesn't contain IPSEC support, so
it's not really any worse either.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/netkey/key.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netkey/key.c
diff -u src/sys/netkey/key.c:1.176 src/sys/netkey/key.c:1.177
--- src/sys/netkey/key.c:1.176	Sun Jan 31 00:43:37 2010
+++ src/sys/netkey/key.c	Wed Mar  3 01:13:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.176 2010/01/31 00:43:37 hubertf Exp $	*/
+/*	$NetBSD: key.c,v 1.177 2010/03/03 01:13:26 pooka Exp $	*/
 /*	$KAME: key.c,v 1.310 2003/09/08 02:23:44 itojun Exp $	*/
 
 /*
@@ -35,11 +35,10 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.176 2010/01/31 00:43:37 hubertf Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.177 2010/03/03 01:13:26 pooka Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
-#include "fs_kernfs.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,9 +94,7 @@
 #endif
 #include <netinet6/ipcomp.h>
 
-#ifdef KERNFS
 #include <miscfs/kernfs/kernfs.h>
-#endif
 
 #include <machine/stdarg.h>
 
@@ -119,6 +116,11 @@
 
 percpu_t *pfkeystat_percpu;
 
+void kernfs_netkey_entangling_noodles(void *);
+void kernfs_netkey_entangling_noodles(void *v) {}
+__weak_alias(kernfs_revoke_sa,kernfs_netkey_entangling_noodles);
+__weak_alias(kernfs_revoke_sp,kernfs_netkey_entangling_noodles);
+
 /*
  * Note on SA reference counting:
  * - SAs that are not in DEAD state will have (total external reference + 1)
@@ -963,9 +965,7 @@
 
 	s = splsoftnet();
 
-#ifdef KERNFS
 	kernfs_revoke_sa(sav);
-#endif
 
 	if (__LIST_CHAINED(sav))
 		LIST_REMOVE(sav, chain);
@@ -1032,9 +1032,7 @@
 
 	s = splsoftnet();	/*called from softclock()*/
 
-#ifdef KERNFS
 	kernfs_revoke_sp(sp);
-#endif
 
     {
 	struct ipsecrequest *isr = sp->req, *nextisr;

Reply via email to