Fix display of multiple nat rules.
Bug spotted by: Luiz Otavio O Souza PR: 120734 MFC After: 3 days
This commit is contained in:
parent
2912059a85
commit
c879f6ecd7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176393
@ -5924,7 +5924,7 @@ show_nat(int ac, char **av) {
|
|||||||
struct cfg_nat *n;
|
struct cfg_nat *n;
|
||||||
struct cfg_redir *e;
|
struct cfg_redir *e;
|
||||||
int cmd, i, nbytes, do_cfg, do_rule, frule, lrule, nalloc, size;
|
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;
|
uint8_t *data, *p;
|
||||||
char **lav, *endptr;
|
char **lav, *endptr;
|
||||||
|
|
||||||
@ -5971,11 +5971,11 @@ show_nat(int ac, char **av) {
|
|||||||
}
|
}
|
||||||
print_nat_config(&data[i]);
|
print_nat_config(&data[i]);
|
||||||
i += sizeof(struct cfg_nat);
|
i += sizeof(struct cfg_nat);
|
||||||
e = (struct cfg_redir *)&data[i];
|
for (redir_cnt = 0; redir_cnt < n->redir_cnt; redir_cnt++) {
|
||||||
if (e->mode == REDIR_ADDR || e->mode == REDIR_PORT ||
|
e = (struct cfg_redir *)&data[i];
|
||||||
e->mode == REDIR_PROTO)
|
|
||||||
i += sizeof(struct cfg_redir) + e->spool_cnt *
|
i += sizeof(struct cfg_redir) + e->spool_cnt *
|
||||||
sizeof(struct cfg_spool);
|
sizeof(struct cfg_spool);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; 1; i += LIBALIAS_BUF_SIZE + sizeof(int)) {
|
for (i = 0; 1; i += LIBALIAS_BUF_SIZE + sizeof(int)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user