mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 01:08:50 +00:00
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>
This commit is contained in:
parent
e608f631f0
commit
8cb4ec44de
@ -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(®s->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(®s->data[priv->sreg_port]);
|
||||
if (!tport)
|
||||
tport = hp->dest;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user