Skip to content

Commit ec2c591

Browse files
a3a3elummakynes
authored andcommitted
netfilter: nft_masq: correct length for loading protocol registers
The values in the protocol registers are two bytes wide. However, when parsing the register loads, the code currently uses the larger 16-byte size of a `union nf_inet_addr`. Change it to use the (correct) size of a `union nf_conntrack_man_proto` instead. Fixes: 8a6bf5d ("netfilter: nft_masq: support port range") Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 068d82e commit ec2c591

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nft_masq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static int nft_masq_init(const struct nft_ctx *ctx,
4343
const struct nft_expr *expr,
4444
const struct nlattr * const tb[])
4545
{
46-
u32 plen = sizeof_field(struct nf_nat_range, min_addr.all);
46+
u32 plen = sizeof_field(struct nf_nat_range, min_proto.all);
4747
struct nft_masq *priv = nft_expr_priv(expr);
4848
int err;
4949

0 commit comments

Comments
 (0)