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

Use FOR_ALL_NETS in message.c.

parent 860bdc12
...@@ -525,13 +525,12 @@ send_request(struct network *net, ...@@ -525,13 +525,12 @@ send_request(struct network *net,
unsigned char hop_count, unsigned short seqno, unsigned char hop_count, unsigned short seqno,
unsigned short router_hash) unsigned short router_hash)
{ {
int i;
if(net == NULL) { if(net == NULL) {
for(i = 0; i < numnets; i++) { struct network *n;
if(!nets[i].up) FOR_ALL_NETS(n) {
if(n->up)
continue; continue;
send_request(&nets[i], prefix, plen, hop_count, seqno, router_hash); send_request(n, prefix, plen, hop_count, seqno, router_hash);
} }
return; return;
} }
...@@ -914,9 +913,9 @@ send_update(struct network *net, int urgent, ...@@ -914,9 +913,9 @@ send_update(struct network *net, int urgent,
} }
if(net == NULL) { if(net == NULL) {
for(i = 0; i < numnets; i++) { struct network *n;
send_update(&nets[i], urgent, prefix, plen); FOR_ALL_NETS(n)
} send_update(n, urgent, prefix, plen);
return; return;
} }
...@@ -989,10 +988,11 @@ send_self_update(struct network *net, int force_seqno) ...@@ -989,10 +988,11 @@ send_self_update(struct network *net, int force_seqno)
update_myseqno(force_seqno); update_myseqno(force_seqno);
if(net == NULL) { if(net == NULL) {
for(i = 0; i < numnets; i++) { struct network *n;
if(!nets[i].up) FOR_ALL_NETS(n) {
if(n->up)
continue; continue;
send_self_update(&nets[i], 0); send_self_update(n, 0);
} }
return; return;
} }
...@@ -1012,10 +1012,11 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -1012,10 +1012,11 @@ send_ihu(struct neighbour *neigh, struct network *net)
int i; int i;
if(neigh == NULL && net == NULL) { if(neigh == NULL && net == NULL) {
for(i = 0; i < numnets; i++) { struct network *n;
if(!nets[i].up) FOR_ALL_NETS(n) {
if(n->up)
continue; continue;
send_ihu(NULL, &nets[i]); send_ihu(NULL, n);
} }
return; return;
} }
......
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