net: add netlink_ext_ack argument to rtnl_link_ops.slave_validate

Add support for extended error reporting.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Matthias Schiffer 2017-06-25 23:56:03 +02:00 committed by David S. Miller
parent 17dd0ec470
commit d116ffc770
2 changed files with 4 additions and 2 deletions

View File

@ -91,7 +91,8 @@ struct rtnl_link_ops {
int slave_maxtype;
const struct nla_policy *slave_policy;
int (*slave_validate)(struct nlattr *tb[],
struct nlattr *data[]);
struct nlattr *data[],
struct netlink_ext_ack *extack);
int (*slave_changelink)(struct net_device *dev,
struct net_device *slave_dev,
struct nlattr *tb[],

View File

@ -2601,7 +2601,8 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
slave_data = slave_attr;
}
if (m_ops->slave_validate) {
err = m_ops->slave_validate(tb, slave_data);
err = m_ops->slave_validate(tb, slave_data,
extack);
if (err < 0)
return err;
}