-Fix display of nat range.
-Whitespace elimination. Bug spotted by: Luiz Otavio O Souza MFC After: 3 days
This commit is contained in:
parent
4bf10a52b0
commit
d956bdf35e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176445
@ -5932,6 +5932,8 @@ show_nat(int ac, char **av) {
|
|||||||
nalloc = 1024;
|
nalloc = 1024;
|
||||||
size = 0;
|
size = 0;
|
||||||
data = NULL;
|
data = NULL;
|
||||||
|
frule = 0;
|
||||||
|
lrule = 65535; /* max ipfw rule number */
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
|
|
||||||
/* Parse parameters. */
|
/* Parse parameters. */
|
||||||
@ -5960,16 +5962,13 @@ show_nat(int ac, char **av) {
|
|||||||
(cmd == IP_FW_NAT_GET_LOG) ? "LOG" : "CONFIG");
|
(cmd == IP_FW_NAT_GET_LOG) ? "LOG" : "CONFIG");
|
||||||
}
|
}
|
||||||
if (nbytes == 0)
|
if (nbytes == 0)
|
||||||
exit(0);
|
exit(0);
|
||||||
if (do_cfg) {
|
if (do_cfg) {
|
||||||
nat_cnt = *((int *)data);
|
nat_cnt = *((int *)data);
|
||||||
for (i = sizeof(nat_cnt); nat_cnt; nat_cnt--) {
|
for (i = sizeof(nat_cnt); nat_cnt; nat_cnt--) {
|
||||||
n = (struct cfg_nat *)&data[i];
|
n = (struct cfg_nat *)&data[i];
|
||||||
if (do_rule) {
|
if (frule <= n->id && lrule >= n->id)
|
||||||
if (!(frule <= n->id && lrule >= n->id))
|
print_nat_config(&data[i]);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
print_nat_config(&data[i]);
|
|
||||||
i += sizeof(struct cfg_nat);
|
i += sizeof(struct cfg_nat);
|
||||||
for (redir_cnt = 0; redir_cnt < n->redir_cnt; redir_cnt++) {
|
for (redir_cnt = 0; redir_cnt < n->redir_cnt; redir_cnt++) {
|
||||||
e = (struct cfg_redir *)&data[i];
|
e = (struct cfg_redir *)&data[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user