diff options
author | Maxim Konovalov <maxim@FreeBSD.org> | 2008-10-14 17:53:26 +0000 |
---|---|---|
committer | Maxim Konovalov <maxim@FreeBSD.org> | 2008-10-14 17:53:26 +0000 |
commit | 92531c02e68cec587101723755f1a79622faaebb (patch) | |
tree | 83e5c771100e95ba7f1829312aaf485dff844365 /sbin | |
parent | 19ff29fb35ef96e677b5f7b76aed8fefbc11d4b9 (diff) | |
download | src-92531c02e68cec587101723755f1a79622faaebb.tar.gz src-92531c02e68cec587101723755f1a79622faaebb.zip |
o Do nothing in show_nat() for a test mode (-n). This prevents
show_nat() from endless loop and makes work ipfw -n nat <...>.
PR: bin/128064
Submitted by: sem
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=183889
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index d7e60a64cdd3..be4a37cc03aa 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -3856,9 +3856,6 @@ nospace: } static void -show_nat(int ac, char **av); - -static void print_nat_config(char *buf) { struct cfg_nat *n; int i, cnt, flag, off; @@ -4066,11 +4063,6 @@ config_nat(int ac, char **av) i = do_cmd(IP_FW_NAT_CFG, buf, off); if (i) err(1, "setsockopt(%s)", "IP_FW_NAT_CFG"); - - /* After every modification, we show the resultant rule. */ - int _ac = 3; - char *_av[] = {"show", "config", id}; - show_nat(_ac, _av); } static void @@ -6035,6 +6027,9 @@ show_nat(int ac, char **av) lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */ ac--; av++; + if (test_only) + return; + /* Parse parameters. */ for (cmd = IP_FW_NAT_GET_LOG, do_cfg = 0; ac != 0; ac--, av++) { if (!strncmp(av[0], "config", strlen(av[0]))) { @@ -6059,6 +6054,7 @@ show_nat(int ac, char **av) if (do_cmd(cmd, data, (uintptr_t)&nbytes) < 0) err(EX_OSERR, "getsockopt(IP_FW_GET_%s)", (cmd == IP_FW_NAT_GET_LOG) ? "LOG" : "CONFIG"); + printf("nbytes %b\n", nbytes); } if (nbytes == 0) exit(0); |