Skip to content

Commit

Permalink
netfilter: xt_nat: fix incorrect hooks for SNAT and DNAT targets
Browse files Browse the repository at this point in the history
In (c7232c9 netfilter: add protocol independent NAT core), the
hooks were accidentally modified:

SNAT hooks are POST_ROUTING and LOCAL_IN (before it was LOCAL_OUT).
DNAT hooks are PRE_ROUTING and LOCAL_OUT (before it was LOCAL_IN).

Signed-off-by: Elison Niven <elison.niven@cyberoam.com>
Signed-off-by: Sanket Shah <sanket.shah@cyberoam.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Elison Niven authored and Pablo Neira Ayuso committed Oct 15, 2012
1 parent 0153d5a commit 939ccba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/netfilter/xt_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.family = NFPROTO_IPV4,
.table = "nat",
.hooks = (1 << NF_INET_POST_ROUTING) |
(1 << NF_INET_LOCAL_OUT),
(1 << NF_INET_LOCAL_IN),
.me = THIS_MODULE,
},
{
Expand All @@ -123,7 +123,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.family = NFPROTO_IPV4,
.table = "nat",
.hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN),
(1 << NF_INET_LOCAL_OUT),
.me = THIS_MODULE,
},
{
Expand All @@ -133,7 +133,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.targetsize = sizeof(struct nf_nat_range),
.table = "nat",
.hooks = (1 << NF_INET_POST_ROUTING) |
(1 << NF_INET_LOCAL_OUT),
(1 << NF_INET_LOCAL_IN),
.me = THIS_MODULE,
},
{
Expand All @@ -143,7 +143,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.targetsize = sizeof(struct nf_nat_range),
.table = "nat",
.hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN),
(1 << NF_INET_LOCAL_OUT),
.me = THIS_MODULE,
},
};
Expand Down

0 comments on commit 939ccba

Please sign in to comment.