summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-12-18 00:59:29 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-12-20 02:12:28 +0100
commit8cb4ec44de42b99b92399b4d1daf3dc430ed0186 (patch)
treefc8591c51a73d48bd2b0d2f6787449219bc22cc8 /net
parente608f631f0ba5f1fc5ee2e260a3a35d13107cbfe (diff)
downloadlinux-8cb4ec44de42b99b92399b4d1daf3dc430ed0186.tar.gz
linux-8cb4ec44de42b99b92399b4d1daf3dc430ed0186.tar.bz2
linux-8cb4ec44de42b99b92399b4d1daf3dc430ed0186.zip
netfilter: nft_tproxy: Fix port selector on Big Endian
On Big Endian architectures, u16 port value was extracted from the wrong parts of u32 sreg_port, just like commit 10596608c4d62 ("netfilter: nf_tables: fix mismatch in big-endian system") describes. Fixes: 4ed8eb6570a49 ("netfilter: nf_tables: Add native tproxy support") Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Florian Westphal <fw@strlen.de> Acked-by: Máté Eckl <ecklm94@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nft_tproxy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nft_tproxy.c b/net/netfilter/nft_tproxy.c
index f92a82c73880..95980154ef02 100644
--- a/net/netfilter/nft_tproxy.c
+++ b/net/netfilter/nft_tproxy.c
@@ -50,7 +50,7 @@ static void nft_tproxy_eval_v4(const struct nft_expr *expr,
taddr = nf_tproxy_laddr4(skb, taddr, iph->daddr);
if (priv->sreg_port)
- tport = regs->data[priv->sreg_port];
+ tport = nft_reg_load16(&regs->data[priv->sreg_port]);
if (!tport)
tport = hp->dest;
@@ -117,7 +117,7 @@ static void nft_tproxy_eval_v6(const struct nft_expr *expr,
taddr = *nf_tproxy_laddr6(skb, &taddr, &iph->daddr);
if (priv->sreg_port)
- tport = regs->data[priv->sreg_port];
+ tport = nft_reg_load16(&regs->data[priv->sreg_port]);
if (!tport)
tport = hp->dest;