Commit d13920e3 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Local notification for xroutes.

parent 7cf10f8d
...@@ -36,6 +36,7 @@ THE SOFTWARE. ...@@ -36,6 +36,7 @@ THE SOFTWARE.
#include "util.h" #include "util.h"
#include "filter.h" #include "filter.h"
#include "network.h" #include "network.h"
#include "local.h"
struct xroute *xroutes; struct xroute *xroutes;
int numxroutes = 0; int numxroutes = 0;
...@@ -61,6 +62,8 @@ flush_xroute(struct xroute *xroute) ...@@ -61,6 +62,8 @@ flush_xroute(struct xroute *xroute)
n = xroute - xroutes; n = xroute - xroutes;
assert(n >= 0 && n < numxroutes); assert(n >= 0 && n < numxroutes);
local_notify_xroute(xroute, 1);
if(n != numxroutes - 1) if(n != numxroutes - 1)
memcpy(xroutes + n, xroutes + numxroutes - 1, sizeof(struct xroute)); memcpy(xroutes + n, xroutes + numxroutes - 1, sizeof(struct xroute));
numxroutes--; numxroutes--;
...@@ -97,6 +100,7 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen, ...@@ -97,6 +100,7 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen,
if(xroute->metric <= metric) if(xroute->metric <= metric)
return 0; return 0;
xroute->metric = metric; xroute->metric = metric;
local_notify_xroute(xroute, 0);
return 1; return 1;
} }
...@@ -119,6 +123,7 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen, ...@@ -119,6 +123,7 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen,
xroutes[numxroutes].ifindex = ifindex; xroutes[numxroutes].ifindex = ifindex;
xroutes[numxroutes].proto = proto; xroutes[numxroutes].proto = proto;
numxroutes++; numxroutes++;
local_notify_xroute(&xroutes[numxroutes - 1], 0);
return 1; return 1;
} }
......
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