Source-Changes-HG archive

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

[src/trunk]: src/sys/netkey Remove #ifdef KERNFS by using weak symbols. Nota...



details:   https://anonhg.NetBSD.org/src/rev/8cbb133f130a
branches:  trunk
changeset: 752666:8cbb133f130a
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Mar 03 01:13:26 2010 +0000

description:
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.

diffstat:

 sys/netkey/key.c |  16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diffs (64 lines):

diff -r bf2b40d82580 -r 8cbb133f130a sys/netkey/key.c
--- a/sys/netkey/key.c  Wed Mar 03 00:56:41 2010 +0000
+++ b/sys/netkey/key.c  Wed Mar 03 01:13:26 2010 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index