version 1.1, 2022/06/22 13:01:55
|
version 1.2, 2022/07/11 17:03:15
|
Line 1
|
Line 1
|
diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c |
diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c |
index 89f21062811..9c773aa4364 100644 | index 1b9c7f324a9..0b2ca745e4d 100644 |
--- a/sbin/ipfw/main.c |
--- a/sbin/ipfw/main.c |
+++ b/sbin/ipfw/main.c |
+++ b/sbin/ipfw/main.c |
@@ -41,6 +41,8 @@ help(void) | @@ -42,6 +42,8 @@ help(void) |
"\tipfw [-abcdefhnNqStTv] <command>\n\n" |
"\tipfw [-abcdefhnNqStTv] <command>\n\n" |
"where <command> is one of the following:\n\n" |
"where <command> is one of the following:\n\n" |
"add [num] [set N] [prob x] RULE-BODY\n" |
"add [num] [set N] [prob x] RULE-BODY\n" |
Line 11 index 89f21062811..9c773aa4364 100644
|
Line 11 index 89f21062811..9c773aa4364 100644
|
"{pipe|queue} N config PIPE-BODY\n" |
"{pipe|queue} N config PIPE-BODY\n" |
"[pipe|queue] {zero|delete|show} [N{,N}]\n" |
"[pipe|queue] {zero|delete|show} [N{,N}]\n" |
"nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|unreg_cgn|\n" |
"nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|unreg_cgn|\n" |
@@ -364,11 +366,14 @@ ipfw_main(int oldac, char **oldav) | @@ -404,11 +406,14 @@ ipfw_main(int oldac, char **oldav) |
/* |
/* |
* Optional: pipe, queue or nat. |
* Optional: pipe, queue or nat. |
*/ |
*/ |
Line 19 index 89f21062811..9c773aa4364 100644
|
Line 19 index 89f21062811..9c773aa4364 100644
|
g_co.do_nat = 0; |
g_co.do_nat = 0; |
g_co.do_pipe = 0; |
g_co.do_pipe = 0; |
g_co.use_set = 0; |
g_co.use_set = 0; |
if (!strncmp(*av, "nat", strlen(*av))) | if (is_ipfw() && !strncmp(*av, "nat", strlen(*av))) |
g_co.do_nat = 1; |
g_co.do_nat = 1; |
+ else if (!strncmp(*av, "sync", strlen(*av))) |
+ else if (!strncmp(*av, "sync", strlen(*av))) |
+ g_co.do_sync = 1; |
+ g_co.do_sync = 1; |
else if (!strncmp(*av, "pipe", strlen(*av))) |
else if (!strncmp(*av, "pipe", strlen(*av))) |
g_co.do_pipe = 1; |
g_co.do_pipe = 1; |
else if (_substrcmp(*av, "queue") == 0) |
else if (_substrcmp(*av, "queue") == 0) |
@@ -388,7 +393,7 @@ ipfw_main(int oldac, char **oldav) | @@ -428,7 +433,7 @@ ipfw_main(int oldac, char **oldav) |
} |
} |
} |
} |
|
|
Line 35 index 89f21062811..9c773aa4364 100644
|
Line 35 index 89f21062811..9c773aa4364 100644
|
ac--; |
ac--; |
av++; |
av++; |
} |
} |
@@ -399,7 +404,7 @@ ipfw_main(int oldac, char **oldav) | @@ -439,7 +444,7 @@ ipfw_main(int oldac, char **oldav) |
* but the code is easier to parse as 'nat|pipe config NN' |
* but the code is easier to parse as 'nat|pipe config NN' |
* so we swap the two arguments. |
* so we swap the two arguments. |
*/ |
*/ |
Line 44 index 89f21062811..9c773aa4364 100644
|
Line 44 index 89f21062811..9c773aa4364 100644
|
char *p = av[0]; |
char *p = av[0]; |
|
|
av[0] = av[1]; |
av[0] = av[1]; |
@@ -411,10 +416,20 @@ ipfw_main(int oldac, char **oldav) | @@ -455,6 +460,16 @@ ipfw_main(int oldac, char **oldav) |
ipfw_add(av); |
ipfw_add(av); |
else if (g_co.do_nat && _substrcmp(*av, "show") == 0) |
else if (g_co.do_nat && _substrcmp(*av, "show") == 0) |
ipfw_show_nat(ac, av); |
ipfw_show_nat(ac, av); |
Line 56 index 89f21062811..9c773aa4364 100644
|
Line 56 index 89f21062811..9c773aa4364 100644
|
+ ipfw_stop_sync(ac, av); |
+ ipfw_stop_sync(ac, av); |
+ else if (g_co.do_sync && _substrcmp(*av, "flush") == 0) |
+ else if (g_co.do_sync && _substrcmp(*av, "flush") == 0) |
+ ipfw_flush_sync(ac, av); |
+ ipfw_flush_sync(ac, av); |
|
+ else if (g_co.do_sync&& _substrcmp(*av, "config") == 0) |
|
+ ipfw_config_sync(ac, av); |
else if (g_co.do_pipe && _substrcmp(*av, "config") == 0) |
else if (g_co.do_pipe && _substrcmp(*av, "config") == 0) |
ipfw_config_pipe(ac, av); |
ipfw_config_pipe(ac, av); |
else if (g_co.do_nat && _substrcmp(*av, "config") == 0) |
else if (g_co.do_nat && _substrcmp(*av, "config") == 0) |
ipfw_config_nat(ac, av); |
|
+ else if (g_co.do_sync&& _substrcmp(*av, "config") == 0) |
|
+ ipfw_config_sync(ac, av); |
|
else if (_substrcmp(*av, "set") == 0) |
|
ipfw_sets_handler(av); |
|
else if (_substrcmp(*av, "table") == 0) |
|