Commit b53c1166 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: set element extended ACK reporting support

Report the element that causes problems via netlink extended ACK for set
element commands.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent aeed55a0
...@@ -5348,9 +5348,11 @@ static int nf_tables_getsetelem(struct sk_buff *skb, ...@@ -5348,9 +5348,11 @@ static int nf_tables_getsetelem(struct sk_buff *skb,
nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) {
err = nft_get_set_elem(&ctx, set, attr); err = nft_get_set_elem(&ctx, set, attr);
if (err < 0) if (err < 0) {
NL_SET_BAD_ATTR(extack, attr);
break; break;
} }
}
return err; return err;
} }
...@@ -6126,9 +6128,11 @@ static int nf_tables_newsetelem(struct sk_buff *skb, ...@@ -6126,9 +6128,11 @@ static int nf_tables_newsetelem(struct sk_buff *skb,
nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) {
err = nft_add_set_elem(&ctx, set, attr, info->nlh->nlmsg_flags); err = nft_add_set_elem(&ctx, set, attr, info->nlh->nlmsg_flags);
if (err < 0) if (err < 0) {
NL_SET_BAD_ATTR(extack, attr);
return err; return err;
} }
}
if (nft_net->validate_state == NFT_VALIDATE_DO) if (nft_net->validate_state == NFT_VALIDATE_DO)
return nft_table_validate(net, table); return nft_table_validate(net, table);
...@@ -6397,9 +6401,11 @@ static int nf_tables_delsetelem(struct sk_buff *skb, ...@@ -6397,9 +6401,11 @@ static int nf_tables_delsetelem(struct sk_buff *skb,
nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) {
err = nft_del_setelem(&ctx, set, attr); err = nft_del_setelem(&ctx, set, attr);
if (err < 0) if (err < 0) {
NL_SET_BAD_ATTR(extack, attr);
break; break;
} }
}
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment