Commit 8d9a9383 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

React to network status changes.

parent 81e8eb6e
...@@ -30,6 +30,7 @@ THE SOFTWARE. ...@@ -30,6 +30,7 @@ THE SOFTWARE.
#include "network.h" #include "network.h"
#include "neighbour.h" #include "neighbour.h"
#include "message.h" #include "message.h"
#include "route.h"
struct network nets[MAXNETS]; struct network nets[MAXNETS];
int numnets = 0; int numnets = 0;
...@@ -146,6 +147,12 @@ check_networks(void) ...@@ -146,6 +147,12 @@ check_networks(void)
if((rc > 0) != nets[i].up) { if((rc > 0) != nets[i].up) {
debugf("Noticed status change for %s.\n", nets[i].ifname); debugf("Noticed status change for %s.\n", nets[i].ifname);
nets[i].up = (rc > 0); nets[i].up = (rc > 0);
if(rc > 0) {
send_self_update(&nets[i], 0);
send_request(&nets[i], NULL, 0, 0, 0, 0);
} else {
flush_network_routes(&nets[i]);
}
} }
} }
} }
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