summaryrefslogtreecommitdiff
path: root/net/ipv4/fib_rules.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-03-10 08:56:18 +0100
committerDavid S. Miller <davem@davemloft.net>2017-03-10 09:45:09 -0800
commitc0243892cbb0e48873d6132f673c830602808245 (patch)
tree8791a5ccdf38e91a3b9d7a091772287cb8c03088 /net/ipv4/fib_rules.c
parent71e8727ebee78f7f6711f272d6ba5d78d0852835 (diff)
downloadlwn-c0243892cbb0e48873d6132f673c830602808245.tar.gz
lwn-c0243892cbb0e48873d6132f673c830602808245.zip
ipv4: fib: Move FIB notification code to a separate file
Most of the code concerned with the FIB notification chain currently resides in fib_trie.c, but this isn't really appropriate, as the FIB notification chain is also used for FIB rules. Therefore, it makes sense to move the common FIB notification code to a separate file and have it export the relevant functions, which can be invoked by its different users (e.g., fib_trie.c, fib_rules.c). 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>
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r--net/ipv4/fib_rules.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index 2e50062f642d..bbd57f099183 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -172,6 +172,15 @@ static int call_fib_rule_notifiers(struct net *net,
return call_fib_notifiers(net, event_type, &info);
}
+void fib_rules_notify(struct net *net, struct notifier_block *nb,
+ enum fib_event_type event_type)
+{
+ struct fib_notifier_info info;
+
+ if (net->ipv4.fib_has_custom_rules)
+ call_fib_notifier(nb, net, event_type, &info);
+}
+
static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = {
FRA_GENERIC_POLICY,
[FRA_FLOW] = { .type = NLA_U32 },