Commit b5ca9970 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Send wildcard retractions at startup and shutdown.

parent 74aecb6d
...@@ -507,6 +507,7 @@ main(int argc, char **argv) ...@@ -507,6 +507,7 @@ main(int argc, char **argv)
usleep(roughly(10000)); usleep(roughly(10000));
gettime(&now); gettime(&now);
send_hello(net); send_hello(net);
send_wildcard_retraction(net);
send_self_update(net, 0); send_self_update(net, 0);
send_request(net, NULL, 0); send_request(net, NULL, 0);
flushupdates(); flushupdates();
...@@ -719,26 +720,18 @@ main(int argc, char **argv) ...@@ -719,26 +720,18 @@ main(int argc, char **argv)
usleep(roughly(10000)); usleep(roughly(10000));
gettime(&now); gettime(&now);
/* Uninstall and retract all routes. */ /* Uninstall and flush all routes. */
while(numroutes > 0) { while(numroutes > 0) {
if(routes[0].installed) { if(routes[0].installed)
uninstall_route(&routes[0]); uninstall_route(&routes[0]);
send_update(NULL, 1, routes[0].src->prefix, routes[0].src->plen);
}
/* We need to flush the route so network_up won't reinstall it */ /* We need to flush the route so network_up won't reinstall it */
flush_route(&routes[0]); flush_route(&routes[0]);
} }
while(numxroutes > 0) {
xroutes[0].metric = INFINITY;
send_update(NULL, 1, xroutes[0].prefix, xroutes[0].plen);
flush_xroute(&xroutes[0]);
}
flushupdates();
FOR_ALL_NETS(net) { FOR_ALL_NETS(net) {
if(!net->up) if(!net->up)
continue; continue;
send_wildcard_retraction(net);
/* Make sure that we expire quickly from our neighbours' /* Make sure that we expire quickly from our neighbours'
association caches. */ association caches. */
send_hello_noupdate(net, 10); send_hello_noupdate(net, 10);
...@@ -750,6 +743,7 @@ main(int argc, char **argv) ...@@ -750,6 +743,7 @@ main(int argc, char **argv)
if(!net->up) if(!net->up)
continue; continue;
/* Make sure they got it. */ /* Make sure they got it. */
send_wildcard_retraction(net);
send_hello_noupdate(net, 1); send_hello_noupdate(net, 1);
flushbuf(net); flushbuf(net);
usleep(roughly(10000)); usleep(roughly(10000));
......
...@@ -816,7 +816,6 @@ really_send_update(struct network *net, ...@@ -816,7 +816,6 @@ really_send_update(struct network *net,
memcpy(net->buffered_prefix, prefix, 16); memcpy(net->buffered_prefix, prefix, 16);
net->have_buffered_prefix = 1; net->have_buffered_prefix = 1;
} }
} }
static int static 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