summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_fw2.c
diff options
context:
space:
mode:
authorpiso <piso@FreeBSD.org>2008-02-24 15:37:45 +0000
committerpiso <piso@FreeBSD.org>2008-02-24 15:37:45 +0000
commita4b4ccad078cd04c874f35be2814b7314a45552b (patch)
tree312a75c049f16e9706f56fc3d98ea7a58e265aa9 /sys/netinet/ip_fw2.c
parent3d3662f90b2bd1277781759f136fa4f543d8f7db (diff)
downloadFreeBSD-src-a4b4ccad078cd04c874f35be2814b7314a45552b.zip
FreeBSD-src-a4b4ccad078cd04c874f35be2814b7314a45552b.tar.gz
Add table/tablearg support to ipfw's nat.
MFC After: 1 week
Diffstat (limited to 'sys/netinet/ip_fw2.c')
-rw-r--r--sys/netinet/ip_fw2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index a094a17..e8c8c81 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -3486,7 +3486,7 @@ check_body:
struct cfg_nat *t;
struct mbuf *mcl;
/* XXX - libalias duct tape */
- int ldt;
+ int ldt, nat_id;
char *c;
ldt = 0;
@@ -3494,7 +3494,9 @@ check_body:
retval = 0;
t = ((ipfw_insn_nat *)cmd)->nat;
if (t == NULL) {
- t = lookup_nat(cmd->arg1);
+ nat_id = (cmd->arg1 == IP_FW_TABLEARG) ?
+ tablearg : cmd->arg1;
+ t = lookup_nat(nat_id);
if (t == NULL) {
retval = IP_FW_DENY;
goto done;
OpenPOWER on IntegriCloud