netlink: Return extack message if attribute validation fails
Have one extack message for parsing and validating. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8d0752d113
commit
7861552ced
|
@ -253,8 +253,8 @@ int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
|
||||||
if (policy) {
|
if (policy) {
|
||||||
err = validate_nla(nla, maxtype, policy);
|
err = validate_nla(nla, maxtype, policy);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
if (extack)
|
NL_SET_ERR_MSG_ATTR(extack, nla,
|
||||||
extack->bad_attr = nla;
|
"Attribute failed policy validation");
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue