From ddc9f8e87fa199a93ea4fd2802ee202825602e02 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Thu, 16 Feb 2017 11:38:50 +0000 Subject: [PATCH] Fix LINT build for powerpc. Build kernel modules support only when both IPSEC and TCP_SIGNATURE are not defined. Reported by: emaste --- sys/netipsec/subr_ipsec.c | 56 +++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/sys/netipsec/subr_ipsec.c b/sys/netipsec/subr_ipsec.c index 5bab2f1dc0d3..acfe66acf458 100644 --- a/sys/netipsec/subr_ipsec.c +++ b/sys/netipsec/subr_ipsec.c @@ -126,9 +126,12 @@ ipsec6_setsockaddrs(const struct mbuf *m, union sockaddr_union *src, #ifdef IPSEC_SUPPORT /* - * Declare IPSEC_SUPPORT as module even if IPSEC is defined. - * tcpmd5.ko module depends from IPSEC_SUPPORT. + * IPSEC_SUPPORT - loading of ipsec.ko and tcpmd5.ko is supported. + * IPSEC + IPSEC_SUPPORT - loading tcpmd5.ko is supported. + * IPSEC + TCP_SIGNATURE - all is build in the kernel, do not build + * IPSEC_SUPPORT. */ +#if !defined(IPSEC) || !defined(TCP_SIGNATURE) #define IPSEC_MODULE_INCR 2 static int ipsec_kmod_enter(volatile u_int *cntr) @@ -181,6 +184,30 @@ type name (decl) \ return (ret); \ } +static int +ipsec_support_modevent(module_t mod, int type, void *data) +{ + + switch (type) { + case MOD_LOAD: + return (0); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t ipsec_support_mod = { + "ipsec_support", + ipsec_support_modevent, + 0 +}; +DECLARE_MODULE(ipsec_support, ipsec_support_mod, SI_SUB_PROTO_DOMAIN, + SI_ORDER_ANY); +MODULE_VERSION(ipsec_support, 1); +#endif /* !IPSEC || !TCP_SIGNATURE */ + #ifndef TCP_SIGNATURE /* Declare TCP-MD5 support as kernel module. */ static struct tcpmd5_support tcpmd5_ipsec = { @@ -222,30 +249,7 @@ tcpmd5_support_disable(void) tcp_ipsec_support->methods = NULL; } } -#endif - -static int -ipsec_support_modevent(module_t mod, int type, void *data) -{ - - switch (type) { - case MOD_LOAD: - return (0); - case MOD_UNLOAD: - return (EBUSY); - default: - return (EOPNOTSUPP); - } -} - -static moduledata_t ipsec_support_mod = { - "ipsec_support", - ipsec_support_modevent, - 0 -}; -DECLARE_MODULE(ipsec_support, ipsec_support_mod, SI_SUB_PROTO_DOMAIN, - SI_ORDER_ANY); -MODULE_VERSION(ipsec_support, 1); +#endif /* !TCP_SIGNATURE */ #ifndef IPSEC /*