Connect zlib to the build.

  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)

Approved by:	re (scottl)
This commit is contained in:
wkoszek 2006-03-01 21:40:14 +00:00
parent a5af09bc1f
commit 8f5b501262
5 changed files with 6 additions and 4 deletions

View File

@ -278,7 +278,8 @@ SUBDIR= ${_3dfx} \
wlan_wep \
wlan_xauth \
${_xe} \
xl
xl \
zlib
.if ${MACHINE_ARCH} != "powerpc"
_syscons= syscons

View File

@ -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 <bsd.kmod.mk>

View File

@ -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)

View File

@ -34,6 +34,7 @@
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <net/ppp_defs.h>
@ -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);

View File

@ -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);