Commit dca1df2f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Ensure strict monotonicity.

parent 95983aad
...@@ -975,11 +975,11 @@ flushupdates(struct network *net) ...@@ -975,11 +975,11 @@ flushupdates(struct network *net)
route->neigh->network == net) route->neigh->network == net)
continue; continue;
if(!route_interferes(route, net)) { if(!route_interferes(route, net)) {
/* Announce a smaller metric. */
metric = metric =
route->refmetric + route->refmetric +
(diversity_factor * route->cost / + 128) / 256 + (diversity_factor * route->cost / + 128) / 256 +
route->add_metric; route->add_metric;
metric = MAX(metric, route->refmetric + 1);
} }
if(route_net->channel == NET_CHANNEL_NONINTERFERING) { if(route_net->channel == NET_CHANNEL_NONINTERFERING) {
memcpy(channels, route->channels, DIVERSITY_HOPS); memcpy(channels, route->channels, DIVERSITY_HOPS);
......
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