summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorpiso <piso@FreeBSD.org>2008-02-18 20:26:34 +0000
committerpiso <piso@FreeBSD.org>2008-02-18 20:26:34 +0000
commit6733058442037a1dbef4e6638c1305b7745013dd (patch)
tree38f3c1be039d5f51345041b0cb6c2ede65dee149 /sbin/ipfw
parent39a559578e0fc5937baa2d07cf17990c305b7cba (diff)
downloadFreeBSD-src-6733058442037a1dbef4e6638c1305b7745013dd.zip
FreeBSD-src-6733058442037a1dbef4e6638c1305b7745013dd.tar.gz
Fix display of multiple nat rules.
Bug spotted by: Luiz Otavio O Souza PR: 120734 MFC After: 3 days
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 1366ab2..41330e6 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -5924,7 +5924,7 @@ show_nat(int ac, char **av) {
struct cfg_nat *n;
struct cfg_redir *e;
int cmd, i, nbytes, do_cfg, do_rule, frule, lrule, nalloc, size;
- int nat_cnt, r;
+ int nat_cnt, redir_cnt, r;
uint8_t *data, *p;
char **lav, *endptr;
@@ -5971,11 +5971,11 @@ show_nat(int ac, char **av) {
}
print_nat_config(&data[i]);
i += sizeof(struct cfg_nat);
- e = (struct cfg_redir *)&data[i];
- if (e->mode == REDIR_ADDR || e->mode == REDIR_PORT ||
- e->mode == REDIR_PROTO)
+ for (redir_cnt = 0; redir_cnt < n->redir_cnt; redir_cnt++) {
+ e = (struct cfg_redir *)&data[i];
i += sizeof(struct cfg_redir) + e->spool_cnt *
sizeof(struct cfg_spool);
+ }
}
} else {
for (i = 0; 1; i += LIBALIAS_BUF_SIZE + sizeof(int)) {
OpenPOWER on IntegriCloud