]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: move extack setting into validate_nla()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 26 Sep 2018 09:15:32 +0000 (11:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Sep 2018 17:24:39 +0000 (10:24 -0700)
commitcc41ae1da2303c5c88a4d503c254c3c114db208a
tree068b778699737fdf5bc184913423daa334412c1a
parent69dc7b549e4dbdbed8320aedb6ce2f79acf30b0f
netlink: move extack setting into validate_nla()

This unifies the code between nla_parse() which sets the bad
attribute pointer and an error message, and nla_validate()
which only sets the bad attribute pointer.

It also cleans up the code for NLA_REJECT and paves the way
for nested policy validation, as it will allow us to easily
skip setting the "generic" message without any extra args
like the **error_msg now, just passing the extack through is
now enough.

While at it, remove the unnecessary label in nla_parse().

Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/nlattr.c