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,10 +412,19 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen, ...@@ -412,10 +412,19 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
return 0; return 0;
if(operation == ROUTE_MODIFY) { if(operation == ROUTE_MODIFY) {
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; metric = newmetric;
gate = newgate; gate = newgate;
ifindex = newifindex; ifindex = newifindex;
} }
}
kdebugf("kernel_route: %s %s/%d metric %d dev %d nexthop %s\n", kdebugf("kernel_route: %s %s/%d metric %d dev %d nexthop %s\n",
operation == ROUTE_ADD ? "add" : operation == ROUTE_ADD ? "add" :
......
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