From 1f2dbfe017c121f62dfaad17db71ac7312ae9320 Mon Sep 17 00:00:00 2001 From: Bart Trojanowski Date: Sat, 8 Jul 2006 10:44:19 -0400 Subject: [PATCH] Make it possible to compile kernel with CONFIG_MODULES=n --- include/openswan/ipsec_rcv.h | 4 +++- net/ipsec/ipsec_alg.c | 2 ++ net/ipsec/pfkey_v2.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/openswan/ipsec_rcv.h b/include/openswan/ipsec_rcv.h index ac71351..df3d92a 100644 --- a/include/openswan/ipsec_rcv.h +++ b/include/openswan/ipsec_rcv.h @@ -37,8 +37,10 @@ #ifdef __KERNEL__ /* struct options; */ #define __NO_VERSION__ -#include #include /* for CONFIG_IP_FORWARD */ +#ifdef CONFIG_MODULES +#include +#endif #include #include diff --git a/net/ipsec/ipsec_alg.c b/net/ipsec/ipsec_alg.c index 68b587c..4732800 100644 --- a/net/ipsec/ipsec_alg.c +++ b/net/ipsec/ipsec_alg.c @@ -1032,6 +1032,7 @@ ipsec_xform_get_info(char *buffer, * symbol problems for old modutils. */ +#ifdef CONFIG_MODULES #ifndef NET_26 #if 0 #ifndef EXPORT_SYMBOL_GPL @@ -1043,3 +1044,4 @@ EXPORT_SYMBOL(register_ipsec_alg); EXPORT_SYMBOL(unregister_ipsec_alg); EXPORT_SYMBOL(ipsec_alg_test); #endif +#endif diff --git a/net/ipsec/pfkey_v2.c b/net/ipsec/pfkey_v2.c index 34b7e42..ddc2f2c 100644 --- a/net/ipsec/pfkey_v2.c +++ b/net/ipsec/pfkey_v2.c @@ -84,8 +84,8 @@ #ifndef SOCKOPS_WRAPPED #define SOCKOPS_WRAPPED(name) name #endif /* SOCKOPS_WRAPPED */ -static rwlock_t pfkey_sock_lock = RW_LOCK_UNLOCKED; #ifdef NET_26 +static rwlock_t pfkey_sock_lock = RW_LOCK_UNLOCKED; HLIST_HEAD(pfkey_sock_list); static DECLARE_WAIT_QUEUE_HEAD(pfkey_sock_wait); static atomic_t pfkey_sock_users = ATOMIC_INIT(0); @@ -1541,6 +1541,7 @@ cleanup_module(void) } #endif /* 0 */ #else /* MODULE */ +struct net_protocol; void pfkey_proto_init(struct net_protocol *pro) { pfkey_init(); -- 1.4.1