Commit 2dc85a4b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Allow infinite metrics in kernel_to_metric.

parent 92ea77f8
...@@ -155,9 +155,12 @@ reinstall_route(struct route *route) ...@@ -155,9 +155,12 @@ reinstall_route(struct route *route)
unsigned int unsigned int
metric_to_kernel(int metric) metric_to_kernel(int metric)
{ {
assert(metric >= 0 && metric < INFINITY); assert(metric >= 0);
return (metric + 255) / 256 + kernel_metric; if(metric >= INFINITY)
return KERNEL_INFINITY;
else
return MIN((metric + 255) / 256 + kernel_metric, KERNEL_INFINITY);
} }
void void
......
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