diff options
author | Ido Schimmel <idosch@mellanox.com> | 2017-08-03 13:28:14 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-03 15:35:59 -0700 |
commit | 1b2a4440858857f2f93bb2ec5bb3a60f4fcc25be (patch) | |
tree | c21cbae70c8a580cf3ddf76cc735d6f5f8f78dd9 /net/ipv4/fib_notifier.c | |
parent | d371ac1e1b1124e22bc9a82a5d170ea721a73bef (diff) | |
download | linux-stable-1b2a4440858857f2f93bb2ec5bb3a60f4fcc25be.tar.gz linux-stable-1b2a4440858857f2f93bb2ec5bb3a60f4fcc25be.tar.bz2 linux-stable-1b2a4440858857f2f93bb2ec5bb3a60f4fcc25be.zip |
net: fib_rules: Implement notification logic in core
Unlike the routing tables, the FIB rules share a common core, so instead
of replicating the same logic for each address family we can simply dump
the rules and send notifications from the core itself.
To protect the integrity of the dump, a rules-specific sequence counter
is added for each address family and incremented whenever a rule is
added or deleted (under RTNL).
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_notifier.c')
-rw-r--r-- | net/ipv4/fib_notifier.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv4/fib_notifier.c b/net/ipv4/fib_notifier.c index 7cf1954bbadc..5d7afb145562 100644 --- a/net/ipv4/fib_notifier.c +++ b/net/ipv4/fib_notifier.c @@ -29,12 +29,17 @@ static unsigned int fib4_seq_read(struct net *net) { ASSERT_RTNL(); - return net->ipv4.fib_seq; + return net->ipv4.fib_seq + fib4_rules_seq_read(net); } static int fib4_dump(struct net *net, struct notifier_block *nb) { - fib_rules_notify(net, nb); + int err; + + err = fib4_rules_dump(net, nb); + if (err) + return err; + fib_notify(net, nb); return 0; |