|
@@ -1943,6 +1943,9 @@ static int nft_ctx_init_from_setattr(struct nft_ctx *ctx,
|
|
|
}
|
|
|
|
|
|
if (nla[NFTA_SET_TABLE] != NULL) {
|
|
|
+ if (afi == NULL)
|
|
|
+ return -EAFNOSUPPORT;
|
|
|
+
|
|
|
table = nf_tables_table_lookup(afi, nla[NFTA_SET_TABLE]);
|
|
|
if (IS_ERR(table))
|
|
|
return PTR_ERR(table);
|
|
@@ -2428,6 +2431,8 @@ static int nf_tables_delset(struct sock *nlsk, struct sk_buff *skb,
|
|
|
struct nft_ctx ctx;
|
|
|
int err;
|
|
|
|
|
|
+ if (nfmsg->nfgen_family == NFPROTO_UNSPEC)
|
|
|
+ return -EAFNOSUPPORT;
|
|
|
if (nla[NFTA_SET_TABLE] == NULL)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -2435,9 +2440,6 @@ static int nf_tables_delset(struct sock *nlsk, struct sk_buff *skb,
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
|
- if (nfmsg->nfgen_family == NFPROTO_UNSPEC)
|
|
|
- return -EAFNOSUPPORT;
|
|
|
-
|
|
|
set = nf_tables_set_lookup(ctx.table, nla[NFTA_SET_NAME]);
|
|
|
if (IS_ERR(set))
|
|
|
return PTR_ERR(set);
|