diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-10-03 11:49:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-04 20:10:56 +0200 |
commit | 55c894f762a1a99fca80ee55d593083d78e7e4fb (patch) | |
tree | 39308305a164ac2fbee70f4f110faa552ca0a7c1 /net/ipv4/ipmr_base.c | |
parent | net: fib_notifier: make FIB notifier per-netns (diff) | |
download | linux-55c894f762a1a99fca80ee55d593083d78e7e4fb.tar.xz linux-55c894f762a1a99fca80ee55d593083d78e7e4fb.zip |
net: fib_notifier: propagate possible error during fib notifier registration
Unlike events for registered notifier, during the registration, the
errors that happened for the block being registered are not propagated
up to the caller. Make sure the error is propagated for FIB rules and
entries.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipmr_base.c')
-rw-r--r-- | net/ipv4/ipmr_base.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c index 4dcc3214e3cc..c4e23c2a0d5c 100644 --- a/net/ipv4/ipmr_base.c +++ b/net/ipv4/ipmr_base.c @@ -409,17 +409,25 @@ int mr_dump(struct net *net, struct notifier_block *nb, unsigned short family, if (!v->dev) continue; - mr_call_vif_notifier(nb, family, - FIB_EVENT_VIF_ADD, - v, vifi, mrt->id); + err = mr_call_vif_notifier(nb, family, + FIB_EVENT_VIF_ADD, + v, vifi, mrt->id); + if (err) + break; } read_unlock(mrt_lock); + if (err) + return err; + /* Notify on table MFC entries */ - list_for_each_entry_rcu(mfc, &mrt->mfc_cache_list, list) - mr_call_mfc_notifier(nb, family, - FIB_EVENT_ENTRY_ADD, - mfc, mrt->id); + list_for_each_entry_rcu(mfc, &mrt->mfc_cache_list, list) { + err = mr_call_mfc_notifier(nb, family, + FIB_EVENT_ENTRY_ADD, + mfc, mrt->id); + if (err) + return err; + } } return 0; |