]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv4: Move call_fib_entry_notifiers up for new routes
authorDavid Ahern <dsa@cumulusnetworks.com>
Wed, 28 Mar 2018 01:21:57 +0000 (18:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Mar 2018 18:10:30 +0000 (14:10 -0400)
commit42d2d1c697099e58550a2fe87e5ccf6fb815eed7
treeabfa6b3efeacc7c14c1f19e0ac1db52c6ae832a7
parent0f1fd901efa35e771517ab5abef9c63d3c90af70
net/ipv4: Move call_fib_entry_notifiers up for new routes

Move call to call_fib_entry_notifiers for new IPv4 routes to right
before the call to fib_insert_alias. At this point the only remaining
failure path is memory allocations in fib_insert_node. Handle that
very unlikely failure with a call to call_fib_entry_notifiers to
tell drivers about it.

At this point notifier handlers can decide the fate of the new route
with a clean path to delete the potential new entry if the notifier
returns non-0.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c