Update the work on ipfw tables, reduce diffs.
[ipfw.git] / dummynet / ip_fw_pfil.c
index 4e3568a..3fa643c 100644 (file)
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD: src/sys/netinet/ip_fw_pfil.c,v 1.25.2.2 2008/04/25 10:26:30
 #include <net/pfil.h>
 #include <net/vnet.h>
 
+#include "missing.h"
+
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/ip_var.h>
@@ -62,11 +64,9 @@ __FBSDID("$FreeBSD: src/sys/netinet/ip_fw_pfil.c,v 1.25.2.2 2008/04/25 10:26:30
 
 #include <machine/in_cksum.h>
 
-#include "missing.h"
-
-int fw_enable = 1;
+VNET_DEFINE(int, fw_enable) = 1;
 #ifdef INET6
-int fw6_enable = 1;
+VNET_DEFINE(int, fw6_enable) = 1;
 #endif
 
 int ipfw_chg_hook(SYSCTL_HANDLER_ARGS);
@@ -127,7 +127,7 @@ again:
        args.m = *m0;
        args.inp = inp;
        ipfw = ipfw_chk(&args);
-       *m0 = args.m;   /* args.m can be modified by ipfw_chk */
+       *m0 = args.m;
        tee = 0;
 
        KASSERT(*m0 != NULL || ipfw == IP_FW_DENY, ("%s: m0 is NULL",
@@ -156,7 +156,6 @@ again:
                goto drop;
                break;                  /* not reached */
 
-       /* here packets come after the ipfw classification */
        case IP_FW_DUMMYNET:
                if (ip_dn_io_ptr == NULL)
                        goto drop;
@@ -258,7 +257,7 @@ again:
        args.oif = ifp;
        args.inp = inp;
        ipfw = ipfw_chk(&args);
-       *m0 = args.m;   /* args.m can be modified by ipfw_chk */
+       *m0 = args.m;
        tee = 0;
 
        KASSERT(*m0 != NULL || ipfw == IP_FW_DENY, ("%s: m0 is NULL",
@@ -432,7 +431,7 @@ nodivert:
        return 1;
 }
 
-static int
+int
 ipfw_hook(void)
 {
        struct pfil_head *pfh_inet;
@@ -449,7 +448,7 @@ ipfw_hook(void)
        return 0;
 }
 
-static int
+int
 ipfw_unhook(void)
 {
        struct pfil_head *pfh_inet;
@@ -467,7 +466,7 @@ ipfw_unhook(void)
 }
 
 #ifdef INET6
-static int
+int
 ipfw6_hook(void)
 {
        struct pfil_head *pfh_inet6;
@@ -484,7 +483,7 @@ ipfw6_hook(void)
        return 0;
 }
 
-static int
+int
 ipfw6_unhook(void)
 {
        struct pfil_head *pfh_inet6;