提交 939ccba4 编写于 作者: E Elison Niven 提交者: Pablo Neira Ayuso

netfilter: xt_nat: fix incorrect hooks for SNAT and DNAT targets

In (c7232c99 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: NElison Niven <elison.niven@cyberoam.com>
Signed-off-by: NSanket Shah <sanket.shah@cyberoam.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 0153d5a8
...@@ -111,7 +111,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = { ...@@ -111,7 +111,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.family = NFPROTO_IPV4, .family = NFPROTO_IPV4,
.table = "nat", .table = "nat",
.hooks = (1 << NF_INET_POST_ROUTING) | .hooks = (1 << NF_INET_POST_ROUTING) |
(1 << NF_INET_LOCAL_OUT), (1 << NF_INET_LOCAL_IN),
.me = THIS_MODULE, .me = THIS_MODULE,
}, },
{ {
...@@ -123,7 +123,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = { ...@@ -123,7 +123,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.family = NFPROTO_IPV4, .family = NFPROTO_IPV4,
.table = "nat", .table = "nat",
.hooks = (1 << NF_INET_PRE_ROUTING) | .hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN), (1 << NF_INET_LOCAL_OUT),
.me = THIS_MODULE, .me = THIS_MODULE,
}, },
{ {
...@@ -133,7 +133,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = { ...@@ -133,7 +133,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.targetsize = sizeof(struct nf_nat_range), .targetsize = sizeof(struct nf_nat_range),
.table = "nat", .table = "nat",
.hooks = (1 << NF_INET_POST_ROUTING) | .hooks = (1 << NF_INET_POST_ROUTING) |
(1 << NF_INET_LOCAL_OUT), (1 << NF_INET_LOCAL_IN),
.me = THIS_MODULE, .me = THIS_MODULE,
}, },
{ {
...@@ -143,7 +143,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = { ...@@ -143,7 +143,7 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = {
.targetsize = sizeof(struct nf_nat_range), .targetsize = sizeof(struct nf_nat_range),
.table = "nat", .table = "nat",
.hooks = (1 << NF_INET_PRE_ROUTING) | .hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN), (1 << NF_INET_LOCAL_OUT),
.me = THIS_MODULE, .me = THIS_MODULE,
}, },
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册