Commit c523d644 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use neighbour_valid throughout.

parent cd96887f
...@@ -895,7 +895,7 @@ dump_tables(FILE *out) ...@@ -895,7 +895,7 @@ dump_tables(FILE *out)
fprintf(out, "My id %s seqno %d\n", format_address(myid), myseqno); fprintf(out, "My id %s seqno %d\n", format_address(myid), myseqno);
for(i = 0; i < numneighs; i++) { for(i = 0; i < numneighs; i++) {
if(neighs[i].hello_seqno == -2) if(!neighbour_valid(&neighs[i]))
continue; continue;
fprintf(out, "Neighbour %s ", format_address(neighs[i].id)); fprintf(out, "Neighbour %s ", format_address(neighs[i].id));
fprintf(out, "at %s dev %s reach %04x rxcost %d txcost %d%s.\n", fprintf(out, "at %s dev %s reach %04x rxcost %d txcost %d%s.\n",
......
...@@ -942,11 +942,11 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -942,11 +942,11 @@ send_ihu(struct neighbour *neigh, struct network *net)
if(neigh == NULL) { if(neigh == NULL) {
for(i = 0; i < numneighs; i++) { for(i = 0; i < numneighs; i++) {
if(neighs[i].hello_seqno != -2) { if(!neighbour_valid(&neighs[i]))
continue;
if(neighs[i].network == net) if(neighs[i].network == net)
send_ihu(&neighs[i], net); send_ihu(&neighs[i], net);
} }
}
} else { } else {
int rxcost, interval; int rxcost, interval;
...@@ -976,7 +976,7 @@ send_marginal_ihu(struct network *net) ...@@ -976,7 +976,7 @@ send_marginal_ihu(struct network *net)
{ {
int i; int i;
for(i = 0; i < numneighs; i++) { for(i = 0; i < numneighs; i++) {
if(neighs[i].hello_seqno == -2 || (net && neighs[i].network != net)) if(!neighbour_valid(&neighs[i]) || (net && neighs[i].network != net))
continue; continue;
if(neighs[i].txcost >= 384 || (neighs[i].reach & 0xF000) != 0xF000) if(neighs[i].txcost >= 384 || (neighs[i].reach & 0xF000) != 0xF000)
send_ihu(&neighs[i], net); send_ihu(&neighs[i], net);
......
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