From owner-svn-src-stable@FreeBSD.ORG Wed Jan 4 16:20:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8840C106564A; Wed, 4 Jan 2012 16:20:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74B708FC19; Wed, 4 Jan 2012 16:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q04GKu1f086205; Wed, 4 Jan 2012 16:20:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04GKupF086196; Wed, 4 Jan 2012 16:20:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201041620.q04GKupF086196@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jan 2012 16:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229497 - in stable/8/sys: conf modules modules/ipfw netinet/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 16:20:56 -0000 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 #include 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 #include 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 __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 #include @@ -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 #include 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 #include