Commit 8d0de1c9 authored by Jondy Zhao's avatar Jondy Zhao

No special action for default route;

Remove the old route when add blackhole route;
parent 791bc592
...@@ -336,6 +336,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen, ...@@ -336,6 +336,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
if(operation == ROUTE_MODIFY) { if(operation == ROUTE_MODIFY) {
if((metric == KERNEL_INFINITY) || if((metric == KERNEL_INFINITY) ||
(newmetric == KERNEL_INFINITY) ||
(ipv4 && plen == 128 && memcmp(dest, newgate, 16) == 0)) { (ipv4 && plen == 128 && memcmp(dest, newgate, 16) == 0)) {
kernel_route(ROUTE_FLUSH, dest, plen, kernel_route(ROUTE_FLUSH, dest, plen,
gate, ifindex, metric, gate, ifindex, metric,
...@@ -349,11 +350,6 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen, ...@@ -349,11 +350,6 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
ifindex = newifindex; ifindex = newifindex;
} }
} }
/* We don't add/delete a blackhole for default route */
else if (newmetric == KERNEL_INFINITY &&
IN6_IS_ADDR_UNSPECIFIED(dest) &&
IN6_IS_ADDR_UNSPECIFIED(newgate))
return 0;
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