From d956bdf35ea3e87c8eac8ce31fa86b9f45eabb98 Mon Sep 17 00:00:00 2001 From: Paolo Pisati Date: Thu, 21 Feb 2008 22:55:54 +0000 Subject: [PATCH] -Fix display of nat range. -Whitespace elimination. Bug spotted by: Luiz Otavio O Souza MFC After: 3 days --- sbin/ipfw/ipfw2.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 41330e6c804a..fa326b886641 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];