Author: bz
Date: Fri Nov  4 16:24:19 2011
New Revision: 227085
URL: http://svn.freebsd.org/changeset/base/227085

Log:
  Always use the opt_*.h options for ipfw.ko, not just when
  compiled into the kernel.
  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.
  
  This should fix an issue where the module would fail to enable
  IPv6 support from the rc framework, but also other INET and INET6
  parts being silently compiled out without giving a warning in the
  module case.
  
  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.
  
  Reported by:  pluknet
  Reviewed by:  plunket, jhb
  MFC After:    3 days

Modified:
  head/sys/modules/Makefile
  head/sys/modules/ipfw/Makefile
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/netinet/ipfw/ip_fw_dynamic.c
  head/sys/netinet/ipfw/ip_fw_log.c
  head/sys/netinet/ipfw/ip_fw_pfil.c
  head/sys/netinet/ipfw/ip_fw_sockopt.c
  head/sys/netinet/ipfw/ip_fw_table.c

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile   Fri Nov  4 16:10:26 2011        (r227084)
+++ head/sys/modules/Makefile   Fri Nov  4 16:24:19 2011        (r227085)
@@ -137,7 +137,7 @@ SUBDIR=     ${_3dfx} \
        ${_io} \
        ipdivert \
        ${_ipfilter} \
-       ipfw \
+       ${_ipfw} \
        ipfw_nat \
        ${_ipmi} \
        ip_mroute_mod \
@@ -379,6 +379,10 @@ _if_carp=  if_carp
 _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: head/sys/modules/ipfw/Makefile
==============================================================================
--- head/sys/modules/ipfw/Makefile      Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/modules/ipfw/Makefile      Fri Nov  4 16:24:19 2011        
(r227085)
@@ -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_inet.h opt_inet6.h opt_ipfw.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

Modified: head/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw2.c      Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/netinet/ipfw/ip_fw2.c      Fri Nov  4 16:24:19 2011        
(r227085)
@@ -31,14 +31,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
 #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: head/sys/netinet/ipfw/ip_fw_dynamic.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_dynamic.c       Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/netinet/ipfw/ip_fw_dynamic.c       Fri Nov  4 16:24:19 2011        
(r227085)
@@ -34,16 +34,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#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: head/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_log.c   Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/netinet/ipfw/ip_fw_log.c   Fri Nov  4 16:24:19 2011        
(r227085)
@@ -31,16 +31,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#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: head/sys/netinet/ipfw/ip_fw_pfil.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_pfil.c  Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/netinet/ipfw/ip_fw_pfil.c  Fri Nov  4 16:24:19 2011        
(r227085)
@@ -28,14 +28,11 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ipfw.h"
-#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 <sys/param.h>
 #include <sys/systm.h>

Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_sockopt.c       Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/netinet/ipfw/ip_fw_sockopt.c       Fri Nov  4 16:24:19 2011        
(r227085)
@@ -34,16 +34,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#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: head/sys/netinet/ipfw/ip_fw_table.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_table.c Fri Nov  4 16:10:26 2011        
(r227084)
+++ head/sys/netinet/ipfw/ip_fw_table.c Fri Nov  4 16:24:19 2011        
(r227085)
@@ -40,16 +40,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#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>
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to