Skip to content

Commit ccbff46

Browse files
committed
netfilter: nft_masq: correct length for loading protocol registers
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2189550 Upstream Status: commit ec2c591 commit ec2c591 Author: Jeremy Sowden <jeremy@azazel.net> Date: Tue Mar 7 23:22:57 2023 +0000 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> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent f920dc0 commit ccbff46

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)