From 2a9247872a703a3bcb78a2be9ecb2559206f69b7 Mon Sep 17 00:00:00 2001 From: Bill Yuan Date: Wed, 25 Feb 2015 14:38:02 +0800 Subject: [PATCH] remove the sysctl handler. --- sbin/ipfw2/ipfw2.c | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/sbin/ipfw2/ipfw2.c b/sbin/ipfw2/ipfw2.c index 161f3d5a61..16ec5b9a3c 100644 --- a/sbin/ipfw2/ipfw2.c +++ b/sbin/ipfw2/ipfw2.c @@ -57,7 +57,7 @@ #include -#include "../../sys/net/ipfw2/ip_fw2.h" +#include "../../sys/net/ipfw2/ip_fw3.h" #include "../../sys/net/dummynet2/ip_dummynet2.h" #include "../../sys/net/libalias/alias.h" #include "../../sys/net/ipfw2_basic/ip_fw2_basic.h" @@ -993,34 +993,6 @@ sets_handler(int ac, char *av[]) errx(EX_USAGE, "invalid set command %s\n", *av); } -static void -sysctl_handler(int ac, char *av[], int which) -{ - NEXT_ARG; - - if (*av == NULL) { - warnx("missing keyword to enable/disable\n"); - } else if (strncmp(*av, "firewall", strlen(*av)) == 0) { - sysctlbyname("net.inet.ip.fw.enable", NULL, 0, - &which, sizeof(which)); - } else if (strncmp(*av, "one_pass", strlen(*av)) == 0) { - sysctlbyname("net.inet.ip.fw.one_pass", NULL, 0, - &which, sizeof(which)); - } else if (strncmp(*av, "debug", strlen(*av)) == 0) { - sysctlbyname("net.inet.ip.fw.debug", NULL, 0, - &which, sizeof(which)); - } else if (strncmp(*av, "verbose", strlen(*av)) == 0) { - sysctlbyname("net.inet.ip.fw.verbose", NULL, 0, - &which, sizeof(which)); - } else if (strncmp(*av, "dyn_keepalive", strlen(*av)) == 0) { - sysctlbyname("net.inet.ip.fw.dyn_keepalive", NULL, 0, - &which, sizeof(which)); - } else { - warnx("unrecognize enable/disable keyword: %s\n", *av); - } -} - - static void add_state(int ac, char *av[]) { @@ -2997,10 +2969,6 @@ ipfw_main(int ac, char **av) } else { errx(EX_USAGE, "bad ipfw module command `%s'", *av); } - } else if (!strncmp(*av, "enable", strlen(*av))) { - sysctl_handler(ac, av, 1); - } else if (!strncmp(*av, "disable", strlen(*av))) { - sysctl_handler(ac, av, 0); } else if (!strncmp(*av, "resetlog", strlen(*av))) { resetlog(ac, av); } else if (!strncmp(*av, "log", strlen(*av))) { -- 2.41.0