summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/ipfw2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ipfw/ipfw2.c')
-rw-r--r--sbin/ipfw/ipfw2.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index fa326b8..91e7932 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -1612,7 +1612,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
break;
case O_NAT:
- printf("nat %u", cmd->arg1);
+ PRINT_UINT_ARG("nat ", cmd->arg1);
break;
default:
@@ -4848,6 +4848,10 @@ add(int ac, char *av[])
action->opcode = O_COUNT;
break;
+ case TOK_NAT:
+ action->opcode = O_NAT;
+ action->len = F_INSN_SIZE(ipfw_insn_nat);
+ goto chkarg;
case TOK_QUEUE:
action->opcode = O_QUEUE;
goto chkarg;
@@ -4929,14 +4933,6 @@ chkarg:
action->opcode = O_COUNT;
ac++; av--; /* go back... */
break;
-
- case TOK_NAT:
- action->opcode = O_NAT;
- action->len = F_INSN_SIZE(ipfw_insn_nat);
- NEED1("missing nat number");
- action->arg1 = strtoul(*av, NULL, 10);
- ac--; av++;
- break;
default:
errx(EX_DATAERR, "invalid action %s\n", av[-1]);
OpenPOWER on IntegriCloud