ipv6: fib_rules: Dump rules during registration to FIB chain
authorIdo Schimmel <idosch@mellanox.com>
Thu, 3 Aug 2017 11:28:18 +0000 (13:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Aug 2017 22:36:00 +0000 (15:36 -0700)
commitdcb18f762f6ac83a6dc9cdc26dd694dcc167beb7
treefad7aaa2d2aac7cb2db4908987cf0da97e9c25a7
parentdf77fe4d9865c6354372876632bcbceeda84f6c8
ipv6: fib_rules: Dump rules during registration to FIB chain

Allow users of the FIB notification chain to receive a complete view of
the IPv6 FIB rules upon registration to the chain.

The integrity of the dump is ensured by a per-family sequence counter
that is incremented (under RTNL) whenever a rule is added or deleted.

All the sequence counters are read (under RTNL) and summed, prior and
after the dump. In case the counters differ, then the dump is either
restarted or the registration fails.

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>
include/net/ip6_fib.h
net/ipv6/fib6_notifier.c
net/ipv6/fib6_rules.c