Skip to content

Commit

Permalink
netlink: Return extack message if attribute validation fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Ahern authored and David S. Miller committed Jun 28, 2018
1 parent 8d0752d commit 7861552
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nlattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
if (policy) {
err = validate_nla(nla, maxtype, policy);
if (err < 0) {
if (extack)
extack->bad_attr = nla;
NL_SET_ERR_MSG_ATTR(extack, nla,
"Attribute failed policy validation");
goto errout;
}
}
Expand Down

0 comments on commit 7861552

Please sign in to comment.