diff options
author | piso <piso@FreeBSD.org> | 2008-02-24 15:37:45 +0000 |
---|---|---|
committer | piso <piso@FreeBSD.org> | 2008-02-24 15:37:45 +0000 |
commit | a4b4ccad078cd04c874f35be2814b7314a45552b (patch) | |
tree | 312a75c049f16e9706f56fc3d98ea7a58e265aa9 /sbin/ipfw | |
parent | 3d3662f90b2bd1277781759f136fa4f543d8f7db (diff) | |
download | FreeBSD-src-a4b4ccad078cd04c874f35be2814b7314a45552b.zip FreeBSD-src-a4b4ccad078cd04c874f35be2814b7314a45552b.tar.gz |
Add table/tablearg support to ipfw's nat.
MFC After: 1 week
Diffstat (limited to 'sbin/ipfw')
-rw-r--r-- | sbin/ipfw/ipfw.8 | 2 | ||||
-rw-r--r-- | sbin/ipfw/ipfw2.c | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 0ea3b7a..fa7a0c5 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1609,7 +1609,7 @@ This can significantly reduce number of rules in some configurations. The .Cm tablearg argument can be used with the following actions: -.Cm pipe , queue, divert, tee, netgraph, ngtee, fwd +.Cm nat, pipe , queue, divert, tee, netgraph, ngtee, fwd action parameters: .Cm tag, untag, rule options: 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]); |