diff --git a/sys/modules/Makefile b/sys/modules/Makefile index f245cc25162f..24b5391f08f6 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -136,7 +136,7 @@ SUBDIR= ${_3dfx} \ ${_igb} \ ${_iir} \ ${_io} \ - ipdivert \ + ${_ipdivert} \ ${_ipfilter} \ ${_ipfw} \ ipfw_nat \ @@ -370,20 +370,21 @@ _random= random .endif .endif -.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) -_if_gre= if_gre -.endif - .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _carp= carp .endif +.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) +_if_gre= if_gre +.endif + .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) _ipfilter= ipfilter .endif .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) +_ipdivert= ipdivert _ipfw= ipfw .endif diff --git a/sys/modules/ipdivert/Makefile b/sys/modules/ipdivert/Makefile index 886802a516b5..14f92ad3d879 100644 --- a/sys/modules/ipdivert/Makefile +++ b/sys/modules/ipdivert/Makefile @@ -1,13 +1,21 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../netinet KMOD= ipdivert -SRCS= ip_divert.c opt_inet6.h +SRCS= ip_divert.c opt_inet.h opt_inet6.h .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: echo "#define INET6 1" > ${.TARGET} .endif +.endif .include diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 5892c9d3af6d..6be6d8b42903 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -30,14 +30,12 @@ #include __FBSDID("$FreeBSD$"); -#if !defined(KLD_MODULE) #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_sctp.h" #ifndef INET #error "IPDIVERT requires INET." #endif -#endif -#include "opt_inet6.h" #include #include