diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2018-03-27 18:21:58 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-29 14:10:30 -0400 |
commit | c1d7ee67acb54b7dc1408929ff70dfe46993e517 (patch) | |
tree | b35edca145e6c6decc9dd9dd1969f1cc57a4d01a /net | |
parent | 6635f311eab40b6d97eb884f371be41d0f5a3ed6 (diff) | |
download | linux-stable-c1d7ee67acb54b7dc1408929ff70dfe46993e517.tar.gz linux-stable-c1d7ee67acb54b7dc1408929ff70dfe46993e517.tar.bz2 linux-stable-c1d7ee67acb54b7dc1408929ff70dfe46993e517.zip |
net/ipv4: Allow notifier to fail route replace
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>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/fib_trie.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 67116233e2bc..3dcffd3ce98c 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); |