Commit 649ffa50 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Minor tweaks to send_ihu.

parent f688b60d
...@@ -842,7 +842,6 @@ void ...@@ -842,7 +842,6 @@ void
send_ihu(struct neighbour *neigh, struct network *net) send_ihu(struct neighbour *neigh, struct network *net)
{ {
int i; int i;
unsigned short interval;
if(neigh == NULL && net == NULL) { if(neigh == NULL && net == NULL) {
for(i = 0; i < numnets; i++) { for(i = 0; i < numnets; i++) {
...@@ -863,7 +862,7 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -863,7 +862,7 @@ send_ihu(struct neighbour *neigh, struct network *net)
delay_jitter(&net->ihu_time, &net->ihu_timeout, delay_jitter(&net->ihu_time, &net->ihu_timeout,
net->ihu_interval); net->ihu_interval);
} else { } else {
int rxcost; int rxcost, interval;
if(net && neigh->network != net) if(net && neigh->network != net)
return; return;
...@@ -872,10 +871,7 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -872,10 +871,7 @@ send_ihu(struct neighbour *neigh, struct network *net)
rxcost = neighbour_rxcost(neigh); rxcost = neighbour_rxcost(neigh);
if((net->ihu_interval + 9) / 10 <= 0xFFFF)
interval = (net->ihu_interval + 9) / 10; interval = (net->ihu_interval + 9) / 10;
else
interval = 0;
debugf("Sending ihu %d on %s to %s (%s).\n", debugf("Sending ihu %d on %s to %s (%s).\n",
rxcost, rxcost,
...@@ -883,6 +879,7 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -883,6 +879,7 @@ send_ihu(struct neighbour *neigh, struct network *net)
format_address(neigh->id), format_address(neigh->id),
format_address(neigh->address)); format_address(neigh->address));
send_message(net, 1, 128, 0, interval, rxcost, neigh->id); send_message(net, 1, 128, 0, interval < 0xFFFF ? interval : 0,
rxcost, neigh->id);
} }
} }
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