Commit 1b2f8d62 authored by Grégoire Henry's avatar Grégoire Henry Committed by Juliusz Chroboczek

Fix blackhole route installation on BSD

parent 03d6d27a
......@@ -412,9 +412,18 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
return 0;
if(operation == ROUTE_MODIFY) {
metric = newmetric;
gate = newgate;
ifindex = newifindex;
if(metric == KERNEL_INFINITY || newmetric == KERNEL_INFINITY) {
kernel_route(ROUTE_FLUSH, dest, plen,
gate, ifindex, metric,
NULL, 0, 0);
return kernel_route(ROUTE_ADD, dest, plen,
newgate, newifindex, newmetric,
NULL, 0, 0);
} else {
metric = newmetric;
gate = newgate;
ifindex = newifindex;
}
}
kdebugf("kernel_route: %s %s/%d metric %d dev %d nexthop %s\n",
......
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