Commit c30d9356 authored by David Ahern's avatar David Ahern Committed by David S. Miller

net: Fix fib notifer to return errno

Notifier handlers use notifier_from_errno to convert any potential error
to an encoded format. As a consequence the other side, call_fib_notifier{s}
in this case, needs to use notifier_to_errno to return the error from
the handler back to its caller.
Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e2135ce
...@@ -13,16 +13,22 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net, ...@@ -13,16 +13,22 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net,
enum fib_event_type event_type, enum fib_event_type event_type,
struct fib_notifier_info *info) struct fib_notifier_info *info)
{ {
int err;
info->net = net; info->net = net;
return nb->notifier_call(nb, event_type, info); err = nb->notifier_call(nb, event_type, info);
return notifier_to_errno(err);
} }
EXPORT_SYMBOL(call_fib_notifier); EXPORT_SYMBOL(call_fib_notifier);
int call_fib_notifiers(struct net *net, enum fib_event_type event_type, int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
struct fib_notifier_info *info) struct fib_notifier_info *info)
{ {
int err;
info->net = net; info->net = net;
return atomic_notifier_call_chain(&fib_chain, event_type, info); err = atomic_notifier_call_chain(&fib_chain, event_type, info);
return notifier_to_errno(err);
} }
EXPORT_SYMBOL(call_fib_notifiers); EXPORT_SYMBOL(call_fib_notifiers);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment