Commit 28e0d58f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Local notification for routes.

parent d13920e3
...@@ -37,6 +37,7 @@ THE SOFTWARE. ...@@ -37,6 +37,7 @@ THE SOFTWARE.
#include "message.h" #include "message.h"
#include "resend.h" #include "resend.h"
#include "filter.h" #include "filter.h"
#include "local.h"
struct route *routes = NULL; struct route *routes = NULL;
int numroutes = 0, maxroutes = 0; int numroutes = 0, maxroutes = 0;
...@@ -86,6 +87,8 @@ flush_route(struct route *route) ...@@ -86,6 +87,8 @@ flush_route(struct route *route)
lost = 1; lost = 1;
} }
local_notify_route(route, 1);
src = route->src; src = route->src;
if(n != numroutes - 1) if(n != numroutes - 1)
...@@ -155,6 +158,7 @@ install_route(struct route *route) ...@@ -155,6 +158,7 @@ install_route(struct route *route)
return; return;
} }
route->installed = 1; route->installed = 1;
local_notify_route(route, 0);
} }
void void
...@@ -173,6 +177,7 @@ uninstall_route(struct route *route) ...@@ -173,6 +177,7 @@ uninstall_route(struct route *route)
perror("kernel_route(FLUSH)"); perror("kernel_route(FLUSH)");
route->installed = 0; route->installed = 0;
local_notify_route(route, 0);
} }
/* This is equivalent to uninstall_route followed with install_route, /* This is equivalent to uninstall_route followed with install_route,
...@@ -201,6 +206,8 @@ switch_routes(struct route *old, struct route *new) ...@@ -201,6 +206,8 @@ switch_routes(struct route *old, struct route *new)
old->installed = 0; old->installed = 0;
new->installed = 1; new->installed = 1;
} }
local_notify_route(old, 0);
local_notify_route(new, 0);
} }
void void
...@@ -226,6 +233,7 @@ change_route_metric(struct route *route, int newmetric) ...@@ -226,6 +233,7 @@ change_route_metric(struct route *route, int newmetric)
} }
} }
route->metric = newmetric; route->metric = newmetric;
local_notify_route(route, 0);
} }
int int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment