diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/nft_masq_ipv4.c | 9 | ||||
-rw-r--r-- | net/ipv4/netfilter/nft_redir_ipv4.c | 11 | ||||
-rw-r--r-- | net/ipv4/netfilter/nft_reject_ipv4.c | 4 |
3 files changed, 10 insertions, 14 deletions
diff --git a/net/ipv4/netfilter/nft_masq_ipv4.c b/net/ipv4/netfilter/nft_masq_ipv4.c index 665de06561cd..40e414c4ca56 100644 --- a/net/ipv4/netfilter/nft_masq_ipv4.c +++ b/net/ipv4/netfilter/nft_masq_ipv4.c | |||
@@ -17,20 +17,17 @@ | |||
17 | #include <net/netfilter/ipv4/nf_nat_masquerade.h> | 17 | #include <net/netfilter/ipv4/nf_nat_masquerade.h> |
18 | 18 | ||
19 | static void nft_masq_ipv4_eval(const struct nft_expr *expr, | 19 | static void nft_masq_ipv4_eval(const struct nft_expr *expr, |
20 | struct nft_data data[NFT_REG_MAX + 1], | 20 | struct nft_regs *regs, |
21 | const struct nft_pktinfo *pkt) | 21 | const struct nft_pktinfo *pkt) |
22 | { | 22 | { |
23 | struct nft_masq *priv = nft_expr_priv(expr); | 23 | struct nft_masq *priv = nft_expr_priv(expr); |
24 | struct nf_nat_range range; | 24 | struct nf_nat_range range; |
25 | unsigned int verdict; | ||
26 | 25 | ||
27 | memset(&range, 0, sizeof(range)); | 26 | memset(&range, 0, sizeof(range)); |
28 | range.flags = priv->flags; | 27 | range.flags = priv->flags; |
29 | 28 | ||
30 | verdict = nf_nat_masquerade_ipv4(pkt->skb, pkt->ops->hooknum, | 29 | regs->verdict.code = nf_nat_masquerade_ipv4(pkt->skb, pkt->ops->hooknum, |
31 | &range, pkt->out); | 30 | &range, pkt->out); |
32 | |||
33 | data[NFT_REG_VERDICT].verdict = verdict; | ||
34 | } | 31 | } |
35 | 32 | ||
36 | static struct nft_expr_type nft_masq_ipv4_type; | 33 | static struct nft_expr_type nft_masq_ipv4_type; |
diff --git a/net/ipv4/netfilter/nft_redir_ipv4.c b/net/ipv4/netfilter/nft_redir_ipv4.c index 6ecfce63201a..312cf6f3b6dc 100644 --- a/net/ipv4/netfilter/nft_redir_ipv4.c +++ b/net/ipv4/netfilter/nft_redir_ipv4.c | |||
@@ -18,26 +18,25 @@ | |||
18 | #include <net/netfilter/nft_redir.h> | 18 | #include <net/netfilter/nft_redir.h> |
19 | 19 | ||
20 | static void nft_redir_ipv4_eval(const struct nft_expr *expr, | 20 | static void nft_redir_ipv4_eval(const struct nft_expr *expr, |
21 | struct nft_data data[NFT_REG_MAX + 1], | 21 | struct nft_regs *regs, |
22 | const struct nft_pktinfo *pkt) | 22 | const struct nft_pktinfo *pkt) |
23 | { | 23 | { |
24 | struct nft_redir *priv = nft_expr_priv(expr); | 24 | struct nft_redir *priv = nft_expr_priv(expr); |
25 | struct nf_nat_ipv4_multi_range_compat mr; | 25 | struct nf_nat_ipv4_multi_range_compat mr; |
26 | unsigned int verdict; | ||
27 | 26 | ||
28 | memset(&mr, 0, sizeof(mr)); | 27 | memset(&mr, 0, sizeof(mr)); |
29 | if (priv->sreg_proto_min) { | 28 | if (priv->sreg_proto_min) { |
30 | mr.range[0].min.all = | 29 | mr.range[0].min.all = |
31 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; | 30 | *(__be16 *)®s->data[priv->sreg_proto_min].data[0]; |
32 | mr.range[0].max.all = | 31 | mr.range[0].max.all = |
33 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; | 32 | *(__be16 *)®s->data[priv->sreg_proto_max].data[0]; |
34 | mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 33 | mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
35 | } | 34 | } |
36 | 35 | ||
37 | mr.range[0].flags |= priv->flags; | 36 | mr.range[0].flags |= priv->flags; |
38 | 37 | ||
39 | verdict = nf_nat_redirect_ipv4(pkt->skb, &mr, pkt->ops->hooknum); | 38 | regs->verdict.code = nf_nat_redirect_ipv4(pkt->skb, &mr, |
40 | data[NFT_REG_VERDICT].verdict = verdict; | 39 | pkt->ops->hooknum); |
41 | } | 40 | } |
42 | 41 | ||
43 | static struct nft_expr_type nft_redir_ipv4_type; | 42 | static struct nft_expr_type nft_redir_ipv4_type; |
diff --git a/net/ipv4/netfilter/nft_reject_ipv4.c b/net/ipv4/netfilter/nft_reject_ipv4.c index a7621faa9678..b07e58b51158 100644 --- a/net/ipv4/netfilter/nft_reject_ipv4.c +++ b/net/ipv4/netfilter/nft_reject_ipv4.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <net/netfilter/nft_reject.h> | 20 | #include <net/netfilter/nft_reject.h> |
21 | 21 | ||
22 | static void nft_reject_ipv4_eval(const struct nft_expr *expr, | 22 | static void nft_reject_ipv4_eval(const struct nft_expr *expr, |
23 | struct nft_data data[NFT_REG_MAX + 1], | 23 | struct nft_regs *regs, |
24 | const struct nft_pktinfo *pkt) | 24 | const struct nft_pktinfo *pkt) |
25 | { | 25 | { |
26 | struct nft_reject *priv = nft_expr_priv(expr); | 26 | struct nft_reject *priv = nft_expr_priv(expr); |
@@ -37,7 +37,7 @@ static void nft_reject_ipv4_eval(const struct nft_expr *expr, | |||
37 | break; | 37 | break; |
38 | } | 38 | } |
39 | 39 | ||
40 | data[NFT_REG_VERDICT].verdict = NF_DROP; | 40 | regs->verdict.code = NF_DROP; |
41 | } | 41 | } |
42 | 42 | ||
43 | static struct nft_expr_type nft_reject_ipv4_type; | 43 | static struct nft_expr_type nft_reject_ipv4_type; |