Fix ip_divert handling of inet and inet6 and module building some more.

Properly sort the "carp" case in modules/Makefile after it was renamed.

Reported by:	bde (most)
Reviewed by:	bde
MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2012-01-22 02:16:31 +00:00
parent 83e521ec73
commit aa57e971bc
3 changed files with 16 additions and 9 deletions

View File

@ -136,7 +136,7 @@ SUBDIR= ${_3dfx} \
${_igb} \ ${_igb} \
${_iir} \ ${_iir} \
${_io} \ ${_io} \
ipdivert \ ${_ipdivert} \
${_ipfilter} \ ${_ipfilter} \
${_ipfw} \ ${_ipfw} \
ipfw_nat \ ipfw_nat \
@ -370,20 +370,21 @@ _random= random
.endif .endif
.endif .endif
.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
_if_gre= if_gre
.endif
.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
defined(ALL_MODULES) defined(ALL_MODULES)
_carp= carp _carp= carp
.endif .endif
.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
_if_gre= if_gre
.endif
.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
_ipfilter= ipfilter _ipfilter= ipfilter
.endif .endif
.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
_ipdivert= ipdivert
_ipfw= ipfw _ipfw= ipfw
.endif .endif

View File

@ -1,13 +1,21 @@
# $FreeBSD$ # $FreeBSD$
.include <bsd.own.mk>
.PATH: ${.CURDIR}/../../netinet .PATH: ${.CURDIR}/../../netinet
KMOD= ipdivert KMOD= ipdivert
SRCS= ip_divert.c opt_inet6.h SRCS= ip_divert.c opt_inet.h opt_inet6.h
.if !defined(KERNBUILDDIR) .if !defined(KERNBUILDDIR)
.if ${MK_INET_SUPPORT} != "no"
opt_inet.h:
echo "#define INET 1" > ${.TARGET}
.endif
.if ${MK_INET6_SUPPORT} != "no"
opt_inet6.h: opt_inet6.h:
echo "#define INET6 1" > ${.TARGET} echo "#define INET6 1" > ${.TARGET}
.endif .endif
.endif
.include <bsd.kmod.mk> .include <bsd.kmod.mk>

View File

@ -30,14 +30,12 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
__FBSDID("$FreeBSD$"); __FBSDID("$FreeBSD$");
#if !defined(KLD_MODULE)
#include "opt_inet.h" #include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_sctp.h" #include "opt_sctp.h"
#ifndef INET #ifndef INET
#error "IPDIVERT requires INET." #error "IPDIVERT requires INET."
#endif #endif
#endif
#include "opt_inet6.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/kernel.h> #include <sys/kernel.h>