diff options
author | Gary Wayne Smith <gary.w.smith@primeexalia.com> | 2005-08-14 20:33:24 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:58:41 -0400 |
commit | 000efe1d86620244b8e017429e57fab4170ab05a (patch) | |
tree | 481faa0d09fccb3835624574030da25492c2e38b | |
parent | 9baa5c67ff4ce57b6b9f68c90714a1bb876fccd7 (diff) |
[NETFILTER]: Make NETMAP target usable in OUTPUT
Signed-off-by: Gary Wayne Smith <gary.w.smith@primeexalia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/netfilter/ipt_NETMAP.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/ipt_NETMAP.c b/net/ipv4/netfilter/ipt_NETMAP.c index 06254b29d034..e6e7b6095363 100644 --- a/net/ipv4/netfilter/ipt_NETMAP.c +++ b/net/ipv4/netfilter/ipt_NETMAP.c | |||
@@ -46,7 +46,8 @@ check(const char *tablename, | |||
46 | DEBUGP(MODULENAME":check: size %u.\n", targinfosize); | 46 | DEBUGP(MODULENAME":check: size %u.\n", targinfosize); |
47 | return 0; | 47 | return 0; |
48 | } | 48 | } |
49 | if (hook_mask & ~((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_POST_ROUTING))) { | 49 | if (hook_mask & ~((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_POST_ROUTING) | |
50 | (1 << NF_IP_LOCAL_OUT))) { | ||
50 | DEBUGP(MODULENAME":check: bad hooks %x.\n", hook_mask); | 51 | DEBUGP(MODULENAME":check: bad hooks %x.\n", hook_mask); |
51 | return 0; | 52 | return 0; |
52 | } | 53 | } |
@@ -76,12 +77,13 @@ target(struct sk_buff **pskb, | |||
76 | struct ip_nat_range newrange; | 77 | struct ip_nat_range newrange; |
77 | 78 | ||
78 | IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING | 79 | IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING |
79 | || hooknum == NF_IP_POST_ROUTING); | 80 | || hooknum == NF_IP_POST_ROUTING |
81 | || hooknum == NF_IP_LOCAL_OUT); | ||
80 | ct = ip_conntrack_get(*pskb, &ctinfo); | 82 | ct = ip_conntrack_get(*pskb, &ctinfo); |
81 | 83 | ||
82 | netmask = ~(mr->range[0].min_ip ^ mr->range[0].max_ip); | 84 | netmask = ~(mr->range[0].min_ip ^ mr->range[0].max_ip); |
83 | 85 | ||
84 | if (hooknum == NF_IP_PRE_ROUTING) | 86 | if (hooknum == NF_IP_PRE_ROUTING || hooknum == NF_IP_LOCAL_OUT) |
85 | new_ip = (*pskb)->nh.iph->daddr & ~netmask; | 87 | new_ip = (*pskb)->nh.iph->daddr & ~netmask; |
86 | else | 88 | else |
87 | new_ip = (*pskb)->nh.iph->saddr & ~netmask; | 89 | new_ip = (*pskb)->nh.iph->saddr & ~netmask; |