Skip to content

Commit 064d705

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) nft_parse_register_load() gets an incorrect datatype size as input, from Jeremy Sowden. 2) incorrect maximum netlink attribute in nft_redir, also from Jeremy. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_redir: correct value of inet type `.maxattrs` netfilter: nft_redir: correct length for loading protocol registers netfilter: nft_masq: correct length for loading protocol registers netfilter: nft_nat: correct length for loading protocol registers ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents dee85ac + 4939245 commit 064d705

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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

net/netfilter/nft_nat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
226226
priv->flags |= NF_NAT_RANGE_MAP_IPS;
227227
}
228228

229-
plen = sizeof_field(struct nf_nat_range, min_addr.all);
229+
plen = sizeof_field(struct nf_nat_range, min_proto.all);
230230
if (tb[NFTA_NAT_REG_PROTO_MIN]) {
231231
err = nft_parse_register_load(tb[NFTA_NAT_REG_PROTO_MIN],
232232
&priv->sreg_proto_min, plen);

net/netfilter/nft_redir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int nft_redir_init(const struct nft_ctx *ctx,
4848
unsigned int plen;
4949
int err;
5050

51-
plen = sizeof_field(struct nf_nat_range, min_addr.all);
51+
plen = sizeof_field(struct nf_nat_range, min_proto.all);
5252
if (tb[NFTA_REDIR_REG_PROTO_MIN]) {
5353
err = nft_parse_register_load(tb[NFTA_REDIR_REG_PROTO_MIN],
5454
&priv->sreg_proto_min, plen);
@@ -236,7 +236,7 @@ static struct nft_expr_type nft_redir_inet_type __read_mostly = {
236236
.name = "redir",
237237
.ops = &nft_redir_inet_ops,
238238
.policy = nft_redir_policy,
239-
.maxattr = NFTA_MASQ_MAX,
239+
.maxattr = NFTA_REDIR_MAX,
240240
.owner = THIS_MODULE,
241241
};
242242

0 commit comments

Comments
 (0)