From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:33973 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841AbeCVW6N (ORCPT ); Thu, 22 Mar 2018 18:58:13 -0400 Received: by mail-pg0-f67.google.com with SMTP id m15so3870480pgc.1 for ; Thu, 22 Mar 2018 15:58:13 -0700 (PDT) From: David Ahern To: netdev@vger.kernel.org Cc: davem@davemloft.net, roopa@cumulusnetworks.com, shm@cumulusnetworks.com, jiri@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, David Ahern Subject: [PATCH RFC net-next 1/7] net: Fix fib notifer to return errno Date: Thu, 22 Mar 2018 15:57:51 -0700 Message-Id: <20180322225757.10377-2-dsa@cumulusnetworks.com> In-Reply-To: <20180322225757.10377-1-dsa@cumulusnetworks.com> References: <20180322225757.10377-1-dsa@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: Notifier handlers use notifier_from_errno to convert any potential error to an encoded format. As a consequence the other side, call_fib_notifiers 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 --- net/core/fib_notifier.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 5ace0705a3f9..14ba52ebe8c9 100644 --- a/net/core/fib_notifier.c +++ b/net/core/fib_notifier.c @@ -21,8 +21,11 @@ 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); -- 2.11.0