summaryrefslogtreecommitdiff
path: root/net/ipv4/fib_trie.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-10-03 11:49:30 +0200
committerDavid S. Miller <davem@davemloft.net>2019-10-04 11:10:56 -0700
commitb7a595577ef3dc9add2b3e6d00869d017306bfbe (patch)
tree61f4fb043e35a7e53fea84e6114f507586c84786 /net/ipv4/fib_trie.c
parent3f9e5c119a47d0fce01f8524ff0aba3acca71bb9 (diff)
net: fib_notifier: propagate extack down to the notifier block callback
Since errors are propagated all the way up to the caller, propagate possible extack of the caller all the way down to the notifier block callback. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 568e59423773..b9df9c09b84e 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -76,9 +76,11 @@
static int call_fib_entry_notifier(struct notifier_block *nb,
enum fib_event_type event_type, u32 dst,
- int dst_len, struct fib_alias *fa)
+ int dst_len, struct fib_alias *fa,
+ struct netlink_ext_ack *extack)
{
struct fib_entry_notifier_info info = {
+ .info.extack = extack,
.dst = dst,
.dst_len = dst_len,
.fi = fa->fa_info,
@@ -2016,7 +2018,8 @@ void fib_info_notify_update(struct net *net, struct nl_info *info)
}
static int fib_leaf_notify(struct key_vector *l, struct fib_table *tb,
- struct notifier_block *nb)
+ struct notifier_block *nb,
+ struct netlink_ext_ack *extack)
{
struct fib_alias *fa;
int err;
@@ -2034,14 +2037,16 @@ static int fib_leaf_notify(struct key_vector *l, struct fib_table *tb,
continue;
err = call_fib_entry_notifier(nb, FIB_EVENT_ENTRY_ADD, l->key,
- KEYLENGTH - fa->fa_slen, fa);
+ KEYLENGTH - fa->fa_slen,
+ fa, extack);
if (err)
return err;
}
return 0;
}
-static int fib_table_notify(struct fib_table *tb, struct notifier_block *nb)
+static int fib_table_notify(struct fib_table *tb, struct notifier_block *nb,
+ struct netlink_ext_ack *extack)
{
struct trie *t = (struct trie *)tb->tb_data;
struct key_vector *l, *tp = t->kv;
@@ -2049,7 +2054,7 @@ static int fib_table_notify(struct fib_table *tb, struct notifier_block *nb)
int err;
while ((l = leaf_walk_rcu(&tp, key)) != NULL) {
- err = fib_leaf_notify(l, tb, nb);
+ err = fib_leaf_notify(l, tb, nb, extack);
if (err)
return err;
@@ -2061,7 +2066,8 @@ static int fib_table_notify(struct fib_table *tb, struct notifier_block *nb)
return 0;
}
-int fib_notify(struct net *net, struct notifier_block *nb)
+int fib_notify(struct net *net, struct notifier_block *nb,
+ struct netlink_ext_ack *extack)
{
unsigned int h;
int err;
@@ -2071,7 +2077,7 @@ int fib_notify(struct net *net, struct notifier_block *nb)
struct fib_table *tb;
hlist_for_each_entry_rcu(tb, head, tb_hlist) {
- err = fib_table_notify(tb, nb);
+ err = fib_table_notify(tb, nb, extack);
if (err)
return err;
}