Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1d7ee67 authored by David Ahern's avatar David Ahern Committed by David S. Miller
Browse files

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: default avatarDavid Ahern <dsa@cumulusnetworks.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6635f311
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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);