summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2018-03-28 04:21:55 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-29 21:10:30 +0300
commitc30d9356e9e8ed0735c1215e187b03d3ae8b4966 (patch)
treeb0bc0dbf1c2a9598341ccf9761f3092e3fa1e64f /net/core
parent6e2135ce54b72f8b2b20cef2a06ae6acb77a3431 (diff)
downloadlinux-c30d9356e9e8ed0735c1215e187b03d3ae8b4966.tar.xz
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: David Ahern <dsa@cumulusnetworks.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/fib_notifier.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c
index 614b985c92a4..13a40b831d6d 100644
--- a/net/core/fib_notifier.c
+++ b/net/core/fib_notifier.c
@@ -13,16 +13,22 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net,
enum fib_event_type event_type,
struct fib_notifier_info *info)
{
+ int err;
+
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);
int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
struct fib_notifier_info *info)
{
+ int err;
+
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);