summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-11-25 23:56:39 +0100
committerSteven Barth <steven@midlink.org>2014-11-25 23:56:39 +0100
commit3c570d03d747f6835bfecbf8a43e0b7092015fad (patch)
treeff045896c1f0208e93db2e87c1f97ad8161f67cf
parentf4ea01b966f911442c763743fd6da2401ab84bcb (diff)
downloadnetifd-3c570d03d747f6835bfecbf8a43e0b7092015fad.tar.gz
Fix setting blackhole-routes to kernel
Signed-off-by: Steven Barth <steven@midlink.org>
-rw-r--r--system-linux.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/system-linux.c b/system-linux.c
index 83827d5..8518f0f 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1412,11 +1412,16 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd)
rtm.rtm_table = RT_TABLE_LOCAL;
}
- if (rtm.rtm_type == RTN_LOCAL || rtm.rtm_type == RTN_NAT)
+ if (rtm.rtm_type == RTN_LOCAL || rtm.rtm_type == RTN_NAT) {
rtm.rtm_scope = RT_SCOPE_HOST;
- else if (rtm.rtm_type == RTN_BROADCAST || rtm.rtm_type == RTN_MULTICAST ||
- rtm.rtm_type == RTN_ANYCAST)
+ } else if (rtm.rtm_type == RTN_BROADCAST || rtm.rtm_type == RTN_MULTICAST ||
+ rtm.rtm_type == RTN_ANYCAST) {
rtm.rtm_scope = RT_SCOPE_LINK;
+ } else if (rtm.rtm_type == RTN_BLACKHOLE || rtm.rtm_type == RTN_UNREACHABLE ||
+ rtm.rtm_type == RTN_PROHIBIT || rtm.rtm_type == RTN_FAILED_POLICY) {
+ rtm.rtm_scope = RT_SCOPE_UNIVERSE;
+ dev = NULL;
+ }
}
msg = nlmsg_alloc_simple(cmd, flags);