summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorleroy christophe <christophe.leroy@c-s.fr>2014-12-22 13:20:14 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-12-23 15:34:28 +0100
commit7b5bca4676c7cd78b0f1ef8a132ef3ba9863c9ef (patch)
treef466b44988780926ca70fab588acc1b5b3c2c21b /net/ipv6
parent70314fc684b3406960dfc2bd1a6af7d9f82f0131 (diff)
downloadlinux-7b5bca4676c7cd78b0f1ef8a132ef3ba9863c9ef.tar.gz
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/ipv6')
-rw-r--r--net/ipv6/netfilter/nft_redir_ipv6.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv6/netfilter/nft_redir_ipv6.c b/net/ipv6/netfilter/nft_redir_ipv6.c
index 2433a6bfb191..11820b6b3613 100644
--- a/net/ipv6/netfilter/nft_redir_ipv6.c
+++ b/net/ipv6/netfilter/nft_redir_ipv6.c
@@ -27,10 +27,10 @@ static void nft_redir_ipv6_eval(const struct nft_expr *expr,
memset(&range, 0, sizeof(range));
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;
}