|
|
@@ -33,6 +33,7 @@
|
|
|
#include <net/ndisc.h>
|
|
|
#include <net/addrconf.h>
|
|
|
#include <net/lwtunnel.h>
|
|
|
+#include <net/fib_notifier.h>
|
|
|
|
|
|
#include <net/ip6_fib.h>
|
|
|
#include <net/ip6_route.h>
|
|
|
@@ -302,6 +303,17 @@ static void __net_init fib6_tables_init(struct net *net)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
+static int call_fib6_entry_notifiers(struct net *net,
|
|
|
+ enum fib_event_type event_type,
|
|
|
+ struct rt6_info *rt)
|
|
|
+{
|
|
|
+ struct fib6_entry_notifier_info info = {
|
|
|
+ .rt = rt,
|
|
|
+ };
|
|
|
+
|
|
|
+ return call_fib6_notifiers(net, event_type, &info.info);
|
|
|
+}
|
|
|
+
|
|
|
static int fib6_dump_node(struct fib6_walker *w)
|
|
|
{
|
|
|
int res;
|
|
|
@@ -879,6 +891,8 @@ add:
|
|
|
*ins = rt;
|
|
|
rt->rt6i_node = fn;
|
|
|
atomic_inc(&rt->rt6i_ref);
|
|
|
+ call_fib6_entry_notifiers(info->nl_net, FIB_EVENT_ENTRY_ADD,
|
|
|
+ rt);
|
|
|
if (!info->skip_notify)
|
|
|
inet6_rt_notify(RTM_NEWROUTE, rt, info, nlflags);
|
|
|
info->nl_net->ipv6.rt6_stats->fib_rt_entries++;
|
|
|
@@ -906,6 +920,8 @@ add:
|
|
|
rt->rt6i_node = fn;
|
|
|
rt->dst.rt6_next = iter->dst.rt6_next;
|
|
|
atomic_inc(&rt->rt6i_ref);
|
|
|
+ call_fib6_entry_notifiers(info->nl_net, FIB_EVENT_ENTRY_REPLACE,
|
|
|
+ rt);
|
|
|
if (!info->skip_notify)
|
|
|
inet6_rt_notify(RTM_NEWROUTE, rt, info, NLM_F_REPLACE);
|
|
|
if (!(fn->fn_flags & RTN_RTINFO)) {
|
|
|
@@ -1459,6 +1475,7 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
|
|
|
|
|
|
fib6_purge_rt(rt, fn, net);
|
|
|
|
|
|
+ call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, rt);
|
|
|
if (!info->skip_notify)
|
|
|
inet6_rt_notify(RTM_DELROUTE, rt, info, 0);
|
|
|
rt6_release(rt);
|