diff options
author | leroy christophe <christophe.leroy@c-s.fr> | 2014-12-22 15:20:14 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-23 17:34:28 +0300 |
commit | 7b5bca4676c7cd78b0f1ef8a132ef3ba9863c9ef (patch) | |
tree | f466b44988780926ca70fab588acc1b5b3c2c21b /net/netfilter | |
parent | 70314fc684b3406960dfc2bd1a6af7d9f82f0131 (diff) | |
download | linux-7b5bca4676c7cd78b0f1ef8a132ef3ba9863c9ef.tar.xz |
netfilter: nf_tables: fix port natting in little endian archs
Make sure this fetches 16-bits port data from the register.
Remove casting to make sparse happy, not needed anymore.
Signed-off-by: leroy christophe <christophe.leroy@c-s.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nft_nat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/nft_nat.c b/net/netfilter/nft_nat.c index afe2b0b45ec4..aff54fb1c8a0 100644 --- a/net/netfilter/nft_nat.c +++ b/net/netfilter/nft_nat.c @@ -65,10 +65,10 @@ static void nft_nat_eval(const struct nft_expr *expr, } if (priv->sreg_proto_min) { - range.min_proto.all = (__force __be16) - data[priv->sreg_proto_min].data[0]; - range.max_proto.all = (__force __be16) - data[priv->sreg_proto_max].data[0]; + range.min_proto.all = + *(__be16 *)&data[priv->sreg_proto_min].data[0]; + range.max_proto.all = + *(__be16 *)&data[priv->sreg_proto_max].data[0]; range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; } |