From 296928cec1bbec980dbc12f6b56a3419651cc819 Mon Sep 17 00:00:00 2001 From: wkoszek Date: Mon, 27 Feb 2006 16:56:22 +0000 Subject: This patch fixes a problem, which exists if you have IPSEC in your kernel and want to have crypto support loaded as KLD. By moving zlib to separate module and adding MODULE_DEPEND directives, it is possible to use such configuration without complication. Otherwise, since IPSEC is linked with zlib (just like crypto.ko) you'll get following error: interface zlib.1 already present in the KLD 'kernel'! Approved by: cognet (mentor) --- sys/modules/crypto/Makefile | 2 -- sys/modules/if_ppp/Makefile | 2 +- sys/net/ppp_deflate.c | 2 ++ sys/opencrypto/cryptodev.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/modules/crypto/Makefile b/sys/modules/crypto/Makefile index 01fdd4b..6d06004 100644 --- a/sys/modules/crypto/Makefile +++ b/sys/modules/crypto/Makefile @@ -6,7 +6,6 @@ .PATH: ${.CURDIR}/../../crypto/des .PATH: ${.CURDIR}/../../crypto/rijndael .PATH: ${.CURDIR}/../../crypto/sha2 -.PATH: ${.CURDIR}/../../net KMOD = crypto SRCS = crypto.c @@ -15,7 +14,6 @@ SRCS += cast.c deflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c SRCS += skipjack.c bf_enc.c bf_skey.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c -SRCS += zlib.c SRCS += opt_param.h .include diff --git a/sys/modules/if_ppp/Makefile b/sys/modules/if_ppp/Makefile index eef495f..1be2e02 100644 --- a/sys/modules/if_ppp/Makefile +++ b/sys/modules/if_ppp/Makefile @@ -16,7 +16,7 @@ PPP_IPX?= 0 # 0/1 - requires IPX to be configured in kernel SRCS+= bsd_comp.c .endif .if ${PPP_DEFLATE} > 0 -SRCS+= ppp_deflate.c zlib.c +SRCS+= ppp_deflate.c .endif .if !defined(KERNBUILDDIR) diff --git a/sys/net/ppp_deflate.c b/sys/net/ppp_deflate.c index 6a49363..0bf0c49 100644 --- a/sys/net/ppp_deflate.c +++ b/sys/net/ppp_deflate.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -676,3 +677,4 @@ z_incomp(arg, mi) state->stats.unc_bytes += rlen; state->stats.unc_packets++; } +MODULE_DEPEND(ppp_deflate, zlib, 1, 1, 1); diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index e0b779d..fa1b0d8 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -820,3 +820,4 @@ static moduledata_t cryptodev_mod = { MODULE_VERSION(cryptodev, 1); DECLARE_MODULE(cryptodev, cryptodev_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_DEPEND(cryptodev, crypto, 1, 1, 1); +MODULE_DEPEND(cryptodev, zlib, 1, 1, 1); -- cgit v1.1