svn commit: r229497 - in stable/8/sys: conf modules modules/ipfw netinet/ipfw

John Baldwin jhb at FreeBSD.org
Wed Jan 4 16:20:56 UTC 2012


Author: jhb
Date: Wed Jan  4 16:20:55 2012
New Revision: 229497
URL: http://svn.freebsd.org/changeset/base/229497

Log:
  MFC 225518,225793,227085:
  Allow the ipfw.ko module built with a kernel to honor any options defined
  in the kernel config.  This more closely matches the behavior of other
  modules which inherit configuration settings from the kernel configuration
  during a kernel + modules build.
  
  Do not try to build the module in case of no INET support but keep #error
  calls for now in case we would compile it into the kernel.
  
  While here garbage collect unneeded opt_*.h includes.
  opt_ipdn.h is not used anywhere but we need to leave the DUMMYNET
  entry in options for conditional inclusion in kernel so keep the
  file with the same name.

Modified:
  stable/8/sys/modules/Makefile
  stable/8/sys/modules/ipfw/Makefile
  stable/8/sys/netinet/ipfw/ip_fw2.c
  stable/8/sys/netinet/ipfw/ip_fw_dynamic.c
  stable/8/sys/netinet/ipfw/ip_fw_log.c
  stable/8/sys/netinet/ipfw/ip_fw_pfil.c
  stable/8/sys/netinet/ipfw/ip_fw_sockopt.c
  stable/8/sys/netinet/ipfw/ip_fw_table.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.32   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/modules/Makefile	Wed Jan  4 16:20:55 2012	(r229497)
@@ -134,7 +134,7 @@ SUBDIR=	${_3dfx} \
 	${_io} \
 	ipdivert \
 	${_ipfilter} \
-	ipfw \
+	${_ipfw} \
 	ipfw_nat \
 	${_ipmi} \
 	ip_mroute_mod \
@@ -366,6 +366,10 @@ _random=	random
 _ipfilter=	ipfilter
 .endif
 
+.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
+_ipfw=		ipfw
+.endif
+
 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
 _netgraph=	netgraph
 .endif

Modified: stable/8/sys/modules/ipfw/Makefile
==============================================================================
--- stable/8/sys/modules/ipfw/Makefile	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/modules/ipfw/Makefile	Wed Jan  4 16:20:55 2012	(r229497)
@@ -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_ipsec.h
+SRCS+=	opt_inet.h opt_inet6.h opt_ipdivert.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}

Modified: stable/8/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw2.c	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/netinet/ipfw/ip_fw2.c	Wed Jan  4 16:20:55 2012	(r229497)
@@ -30,15 +30,12 @@ __FBSDID("$FreeBSD$");
  * The FreeBSD IP packet firewall, main file
  */
 
-#if !defined(KLD_MODULE)
 #include "opt_ipfw.h"
 #include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
 

Modified: stable/8/sys/netinet/ipfw/ip_fw_dynamic.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_dynamic.c	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/netinet/ipfw/ip_fw_dynamic.c	Wed Jan  4 16:20:55 2012	(r229497)
@@ -33,17 +33,12 @@ __FBSDID("$FreeBSD$");
  * Dynamic rule support for ipfw
  */
 
-#if !defined(KLD_MODULE)
 #include "opt_ipfw.h"
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: stable/8/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_log.c	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/netinet/ipfw/ip_fw_log.c	Wed Jan  4 16:20:55 2012	(r229497)
@@ -30,17 +30,12 @@ __FBSDID("$FreeBSD$");
  * Logging support for ipfw
  */
 
-#if !defined(KLD_MODULE)
 #include "opt_ipfw.h"
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: stable/8/sys/netinet/ipfw/ip_fw_pfil.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_pfil.c	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/netinet/ipfw/ip_fw_pfil.c	Wed Jan  4 16:20:55 2012	(r229497)
@@ -27,15 +27,12 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#if !defined(KLD_MODULE)
 #include "opt_ipfw.h"
-#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>
@@ -150,7 +147,7 @@ again:
 		/* next_hop may be set by ipfw_chk */
                 if (args.next_hop == NULL)
                         break; /* pass */
-#ifndef IPFIREWALL_FORWARD
+#if !defined(IPFIREWALL_FORWARD) || (!defined(INET6) && !defined(INET))
 		ret = EACCES;
 #else
 	    {
@@ -178,7 +175,7 @@ again:
 		if (in_localip(args.next_hop->sin_addr))
 			(*m0)->m_flags |= M_FASTFWD_OURS;
 	    }
-#endif
+#endif /* IPFIREWALL_FORWARD */
 		break;
 
 	case IP_FW_DENY:

Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c	Wed Jan  4 16:20:55 2012	(r229497)
@@ -33,17 +33,12 @@ __FBSDID("$FreeBSD$");
  * the upper half of the ipfw code.
  */
 
-#if !defined(KLD_MODULE)
 #include "opt_ipfw.h"
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_table.c	Wed Jan  4 16:07:16 2012	(r229496)
+++ stable/8/sys/netinet/ipfw/ip_fw_table.c	Wed Jan  4 16:20:55 2012	(r229497)
@@ -39,17 +39,12 @@ __FBSDID("$FreeBSD$");
  * from userland, because operations are typically fast.
  */
 
-#if !defined(KLD_MODULE)
 #include "opt_ipfw.h"
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>


More information about the svn-src-all mailing list