net: Add extack to fib_notifier_info
Add extack to fib_notifier_info and plumb through stack to call_fib_rule_notifiers, call_fib_entry_notifiers and call_fib6_entry_notifiers. This allows notifer handlers to return messages to user. Signed-off-by: David Ahern <dsahern@gmail.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4f6265d485
commit
6c31e5a91f
@@ -314,10 +314,12 @@ static int call_fib_rule_notifier(struct notifier_block *nb, struct net *net,
|
||||
static int call_fib_rule_notifiers(struct net *net,
|
||||
enum fib_event_type event_type,
|
||||
struct fib_rule *rule,
|
||||
struct fib_rules_ops *ops)
|
||||
struct fib_rules_ops *ops,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct fib_rule_notifier_info info = {
|
||||
.info.family = ops->family,
|
||||
.info.extack = extack,
|
||||
.rule = rule,
|
||||
};
|
||||
|
||||
@@ -609,7 +611,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
if (rule->tun_id)
|
||||
ip_tunnel_need_metadata();
|
||||
|
||||
call_fib_rule_notifiers(net, FIB_EVENT_RULE_ADD, rule, ops);
|
||||
call_fib_rule_notifiers(net, FIB_EVENT_RULE_ADD, rule, ops, extack);
|
||||
notify_rule_change(RTM_NEWRULE, rule, ops, nlh, NETLINK_CB(skb).portid);
|
||||
flush_route_cache(ops);
|
||||
rules_ops_put(ops);
|
||||
@@ -749,7 +751,8 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
}
|
||||
}
|
||||
|
||||
call_fib_rule_notifiers(net, FIB_EVENT_RULE_DEL, rule, ops);
|
||||
call_fib_rule_notifiers(net, FIB_EVENT_RULE_DEL, rule, ops,
|
||||
NULL);
|
||||
notify_rule_change(RTM_DELRULE, rule, ops, nlh,
|
||||
NETLINK_CB(skb).portid);
|
||||
fib_rule_put(rule);
|
||||
|
Reference in New Issue
Block a user