All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
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 <dsa@cumulusnetworks.com>
Subject: [PATCH RFC net-next 4/7] net/ipv4: Allow notifier to fail route repolace
Date: Thu, 22 Mar 2018 15:57:54 -0700	[thread overview]
Message-ID: <20180322225757.10377-5-dsa@cumulusnetworks.com> (raw)
In-Reply-To: <20180322225757.10377-1-dsa@cumulusnetworks.com>

Add checking to call to call_fib_entry_notifiers for IPv4 route replace.
Allows a notifier handler to fail the replace.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
 net/ipv4/fib_trie.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index d0f70a16f8de..113822aa9ea7 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1219,8 +1219,13 @@ int fib_table_insert(struct net *net, struct fib_table *tb,
 			new_fa->tb_id = tb->tb_id;
 			new_fa->fa_default = -1;
 
-			call_fib_entry_notifiers(net, FIB_EVENT_ENTRY_REPLACE,
-						 key, plen, new_fa, extack);
+			err = call_fib_entry_notifiers(net,
+						       FIB_EVENT_ENTRY_REPLACE,
+						       key, plen, new_fa,
+						       extack);
+			if (err)
+				goto out_free_new_fa;
+
 			rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen,
 				  tb->tb_id, &cfg->fc_nlinfo, nlflags);
 
-- 
2.11.0

  parent reply	other threads:[~2018-03-22 22:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 22:57 [PATCH RFC net-next 0/7] net: Allow FIB notifiers to fail add and replace David Ahern
2018-03-22 22:57 ` [PATCH RFC net-next 1/7] net: Fix fib notifer to return errno David Ahern
2018-03-25  8:16   ` Ido Schimmel
2018-03-25 14:00     ` David Ahern
2018-03-25 15:37       ` Ido Schimmel
2018-03-22 22:57 ` [PATCH RFC net-next 2/7] net: Move call_fib_rule_notifiers up in fib_nl_newrule David Ahern
2018-03-22 22:57 ` [PATCH RFC net-next 3/7] net/ipv4: Move call_fib_entry_notifiers up for new routes David Ahern
2018-03-22 22:57 ` David Ahern [this message]
2018-03-22 22:57 ` [PATCH RFC net-next 5/7] net/ipv6: Move call_fib6_entry_notifiers up for route adds David Ahern
2018-03-22 22:57 ` [PATCH RFC net-next 6/7] devlink: Export methods to get and set namespace David Ahern
2018-03-22 22:57 ` [PATCH RFC net-next 7/7] netdevsim: Add simple FIB resource controller via devlink David Ahern
2018-03-23  6:50   ` Jiri Pirko
2018-03-23 14:31     ` David Ahern
2018-03-23 15:01       ` Jiri Pirko
2018-03-23 15:03         ` David Ahern
2018-03-23 15:05           ` Jiri Pirko
2018-03-23 15:13             ` David Ahern
2018-03-24  7:26               ` Jiri Pirko
2018-03-24 15:05                 ` David Ahern
2018-03-24 16:02                   ` Jiri Pirko
2018-03-25 14:24                     ` David Ahern
2018-03-26 14:33                       ` Jiri Pirko
2018-03-24  3:47   ` Jakub Kicinski
2018-03-24 15:02     ` David Ahern
2018-03-25  6:35       ` Jakub Kicinski
2018-03-25 14:27         ` David Ahern
2018-03-25 19:53           ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180322225757.10377-5-dsa@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=shm@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.