OSDN Git Service

ipv4: fib_rules: Dump FIB rules when registering FIB notifier
authorIdo Schimmel <idosch@mellanox.com>
Thu, 16 Mar 2017 08:08:14 +0000 (09:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Mar 2017 17:18:34 +0000 (10:18 -0700)
commit5d7bfd141924a5ece21eb612ad3c56612f041c1e
tree8c50f41a25f577b34c7bf6150a4f922ddf12bb18
parent6a003a5ff29499a94373110202631743663569c6
ipv4: fib_rules: Dump FIB rules when registering FIB notifier

In commit c3852ef7f2f8 ("ipv4: fib: Replay events when registering FIB
notifier") we dumped the FIB tables and replayed the events to the
passed notification block.

However, we merely sent a RULE_ADD notification in case custom rules
were in use. As explained in previous patches, this approach won't work
anymore. Instead, we should notify the caller about all the FIB rules
and let it act accordingly.

Upon registration to the FIB notification chain, replay a RULE_ADD
notification for each programmed FIB rule, custom or not. The integrity
of the dump is ensured by the mechanism introduced in the above
mentioned commit.

Prevent regressions by making sure current listeners correctly sanitize
the notified rules.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/rocker/rocker_main.c
net/ipv4/fib_rules.c