Skip to content

Commit c271cc9

Browse files
committed
netfilter: nf_tables: release new hooks on unsupported flowtable flags
Release the list of new hooks that are pending to be registered in case that unsupported flowtable flags are provided. Fixes: 78d9f48 ("netfilter: nf_tables: add devices to existing flowtable") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 2c9e455 commit c271cc9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7433,11 +7433,15 @@ static int nft_flowtable_update(struct nft_ctx *ctx, const struct nlmsghdr *nlh,
74337433

74347434
if (nla[NFTA_FLOWTABLE_FLAGS]) {
74357435
flags = ntohl(nla_get_be32(nla[NFTA_FLOWTABLE_FLAGS]));
7436-
if (flags & ~NFT_FLOWTABLE_MASK)
7437-
return -EOPNOTSUPP;
7436+
if (flags & ~NFT_FLOWTABLE_MASK) {
7437+
err = -EOPNOTSUPP;
7438+
goto err_flowtable_update_hook;
7439+
}
74387440
if ((flowtable->data.flags & NFT_FLOWTABLE_HW_OFFLOAD) ^
7439-
(flags & NFT_FLOWTABLE_HW_OFFLOAD))
7440-
return -EOPNOTSUPP;
7441+
(flags & NFT_FLOWTABLE_HW_OFFLOAD)) {
7442+
err = -EOPNOTSUPP;
7443+
goto err_flowtable_update_hook;
7444+
}
74417445
} else {
74427446
flags = flowtable->data.flags;
74437447
}

0 commit comments

Comments
 (0)