diff options
author | piso <piso@FreeBSD.org> | 2008-02-21 22:55:54 +0000 |
---|---|---|
committer | piso <piso@FreeBSD.org> | 2008-02-21 22:55:54 +0000 |
commit | 47b2af9c1cb1409bf9100c13eba277a47a02c22d (patch) | |
tree | 667aac493dee7c89bd7bda1decf238480dcaa3d9 | |
parent | 109c3fd18089f9a11d732bc2bcf477ba4769e104 (diff) | |
download | FreeBSD-src-47b2af9c1cb1409bf9100c13eba277a47a02c22d.zip FreeBSD-src-47b2af9c1cb1409bf9100c13eba277a47a02c22d.tar.gz |
-Fix display of nat range.
-Whitespace elimination.
Bug spotted by: Luiz Otavio O Souza
MFC After: 3 days
-rw-r--r-- | sbin/ipfw/ipfw2.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 41330e6..fa326b8 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -5932,6 +5932,8 @@ show_nat(int ac, char **av) { nalloc = 1024; size = 0; data = NULL; + frule = 0; + lrule = 65535; /* max ipfw rule number */ ac--; av++; /* Parse parameters. */ @@ -5960,16 +5962,13 @@ show_nat(int ac, char **av) { (cmd == IP_FW_NAT_GET_LOG) ? "LOG" : "CONFIG"); } if (nbytes == 0) - exit(0); + exit(0); if (do_cfg) { nat_cnt = *((int *)data); for (i = sizeof(nat_cnt); nat_cnt; nat_cnt--) { n = (struct cfg_nat *)&data[i]; - if (do_rule) { - if (!(frule <= n->id && lrule >= n->id)) - continue; - } - print_nat_config(&data[i]); + if (frule <= n->id && lrule >= n->id) + print_nat_config(&data[i]); i += sizeof(struct cfg_nat); for (redir_cnt = 0; redir_cnt < n->redir_cnt; redir_cnt++) { e = (struct cfg_redir *)&data[i]; |