Commit 4ab13977 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement check_networks.

parent afca5644
...@@ -136,3 +136,16 @@ update_jitter(struct network *net, int urgent) ...@@ -136,3 +136,16 @@ update_jitter(struct network *net, int urgent)
interval = MIN(interval, 100); interval = MIN(interval, 100);
return (interval / 2 + random() % interval); return (interval / 2 + random() % interval);
} }
void
check_networks(void)
{
int i, rc;
for(i = 0; i < numnets; i++) {
rc = kernel_interface_operational(nets[i].ifname, nets[i].ifindex);
if(rc != nets[i].up) {
debugf("Noticed status change for %s.\n", nets[i].ifname);
nets[i].up = rc;
}
}
}
...@@ -53,3 +53,4 @@ int network_idle(struct network *net); ...@@ -53,3 +53,4 @@ int network_idle(struct network *net);
int update_hello_interval(struct network *net); int update_hello_interval(struct network *net);
unsigned int jitter(struct network *net); unsigned int jitter(struct network *net);
unsigned int update_jitter(struct network *net, int urgent); unsigned int update_jitter(struct network *net, int urgent);
void check_networks(void);
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