Unbreak no-ip and no-inet6 module builds with ipfw. For now continue to

build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the
assumption that the private L2 hook (which hopefully eventually will be a
pfil hook as well) can still be useful.

Allow building the module without inet as well.

Glanced at by:	jhb
MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2011-09-27 13:27:17 +00:00
parent ce8bd78b2a
commit 75e54d6017
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=225793
2 changed files with 8 additions and 4 deletions

View file

@ -8,7 +8,7 @@ KMOD= ipfw
SRCS= ip_fw2.c ip_fw_pfil.c
SRCS+= ip_fw_dynamic.c ip_fw_log.c
SRCS+= ip_fw_sockopt.c ip_fw_table.c
SRCS+= opt_inet6.h opt_ipfw.h opt_ipsec.h
SRCS+= opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
CFLAGS+= -DIPFIREWALL
CFLAGS+= -I${.CURDIR}/../../contrib/pf
@ -22,6 +22,10 @@ CFLAGS+= -I${.CURDIR}/../../contrib/pf
#
.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}

View file

@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
#if !defined(KLD_MODULE)
#include "opt_ipdn.h"
#include "opt_inet.h"
#include "opt_inet6.h"
#ifndef INET
#error IPFIREWALL requires INET.
#endif /* INET */
#endif /* KLD_MODULE */
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -154,7 +154,7 @@ ipfw_check_hook(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir,
/* next_hop may be set by ipfw_chk */
if (args.next_hop == NULL && args.next_hop6 == NULL)
break; /* pass */
#ifndef IPFIREWALL_FORWARD
#if !defined(IPFIREWALL_FORWARD) || (!defined(INET6) && !defined(INET))
ret = EACCES;
#else
{
@ -205,7 +205,7 @@ ipfw_check_hook(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir,
#endif
m_tag_prepend(*m0, fwd_tag);
}
#endif
#endif /* IPFIREWALL_FORWARD */
break;
case IP_FW_DENY: