Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 519582e4 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Greg Kroah-Hartman
Browse files

netfilter: nft_nat: allow to specify layer 4 protocol NAT only



[ Upstream commit a33f387ecd5aafae514095c2c4a8c24f7aea7e8b ]

nft_nat reports a bogus EAFNOSUPPORT if no layer 3 information is specified.

Fixes: d07db988 ("netfilter: nf_tables: introduce nft_validate_register_load()")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3a7a4cee
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -147,7 +147,9 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
		alen = FIELD_SIZEOF(struct nf_nat_range, min_addr.ip6);
		break;
	default:
		if (tb[NFTA_NAT_REG_ADDR_MIN])
			return -EAFNOSUPPORT;
		break;
	}
	priv->family = family;