Commit 3118ef51 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove broadcast_ihu.

This also fixes a bug in sending ihu intervals.
parent 5785b018
...@@ -184,8 +184,6 @@ main(int argc, char **argv) ...@@ -184,8 +184,6 @@ main(int argc, char **argv)
goto syntax; goto syntax;
} else if(strcmp(*arg, "-s") == 0) { } else if(strcmp(*arg, "-s") == 0) {
split_horizon = 0; split_horizon = 0;
} else if(strcmp(*arg, "-b") == 0) {
broadcast_ihu = 1;
} else if(strcmp(*arg, "-S") == 0) { } else if(strcmp(*arg, "-S") == 0) {
SHIFTE(); SHIFTE();
state_file = *arg; state_file = *arg;
......
...@@ -45,7 +45,6 @@ const unsigned char packet_header[8] = {42, 1}; ...@@ -45,7 +45,6 @@ const unsigned char packet_header[8] = {42, 1};
int add_cost = 0; int add_cost = 0;
int parasitic = 0; int parasitic = 0;
int silent_time = 30; int silent_time = 30;
int broadcast_ihu = 0;
int split_horizon = 1; int split_horizon = 1;
unsigned short myseqno = 0; unsigned short myseqno = 0;
...@@ -143,11 +142,11 @@ parse_packet(const unsigned char *from, struct network *net, ...@@ -143,11 +142,11 @@ parse_packet(const unsigned char *from, struct network *net,
continue; continue;
net->activity_time = now.tv_sec; net->activity_time = now.tv_sec;
if(type == 1) { if(type == 1) {
debugf("Received ihu %d for %s from %s (%s).\n", debugf("Received ihu %d for %s from %s (%s) %d.\n",
metric, metric,
format_address(address), format_address(address),
format_address(neigh->id), format_address(neigh->id),
format_address(from)); format_address(from), seqno);
if(plen == 0xFF || memcmp(myid, address, 16) == 0) { if(plen == 0xFF || memcmp(myid, address, 16) == 0) {
neigh->txcost = metric; neigh->txcost = metric;
neigh->ihu_time = now; neigh->ihu_time = now;
...@@ -816,22 +815,11 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -816,22 +815,11 @@ send_ihu(struct neighbour *neigh, struct network *net)
return; return;
} }
if(net && net->ihu_interval * 100 <= 0xFFFF)
interval = net->ihu_interval * 100;
else
interval = 0;
if(neigh == NULL) { if(neigh == NULL) {
if(broadcast_ihu && net->wired) { for(i = 0; i < numneighs; i++) {
debugf("Sending broadcast ihu %d to %s.\n", if(neighs[i].id[0] != 0xFF) {
net->cost, net->ifname); if(neighs[i].network == net)
send_message(net, 1, 0xFF, 0, interval, net->cost, ones); send_ihu(&neighs[i], net);
} else {
for(i = 0; i < numneighs; i++) {
if(neighs[i].id[0] != 0xFF) {
if(neighs[i].network == net)
send_ihu(&neighs[i], net);
}
} }
} }
net->ihu_time = now.tv_sec; net->ihu_time = now.tv_sec;
...@@ -845,6 +833,11 @@ send_ihu(struct neighbour *neigh, struct network *net) ...@@ -845,6 +833,11 @@ send_ihu(struct neighbour *neigh, struct network *net)
rxcost = neighbour_rxcost(neigh); rxcost = neighbour_rxcost(neigh);
if(net->ihu_interval * 100 <= 0xFFFF)
interval = net->ihu_interval * 100;
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,
neigh->network->ifname, neigh->network->ifname,
......
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