summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2018-12-19 19:13:15 +0100
committerDmitry Kozlov <xeb@mail.ru>2018-12-20 06:21:33 +0300
commit525fe7ee879c758f91b1f48c25598775ac6d62ad (patch)
tree3c03c59c730beab8525d49ba47e7fd2103990d6c
parent55bcbfff7cc59d7607dea22a1bb7dfe55a13d174 (diff)
downloadaccel-ppp-525fe7ee879c758f91b1f48c25598775ac6d62ad.tar.gz
accel-ppp-525fe7ee879c758f91b1f48c25598775ac6d62ad.zip
iputils: always set scope to RT_SCOPE_UNIVERSE in ip6route_{add,del}()
No need to be clever here. All IPv6 routes have global scope (kernel ignores rtm_scope for IPv6 and always reports RT_SCOPE_UNIVERSE when dumping such routes). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
-rw-r--r--accel-pppd/libnetlink/iputils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c
index ffa5726..f04f348 100644
--- a/accel-pppd/libnetlink/iputils.c
+++ b/accel-pppd/libnetlink/iputils.c
@@ -563,7 +563,7 @@ int __export ip6route_add(int ifindex, const struct in6_addr *dst, int pref_len,
req.n.nlmsg_type = RTM_NEWROUTE;
req.i.rtm_family = AF_INET6;
req.i.rtm_table = RT_TABLE_MAIN;
- req.i.rtm_scope = (pref_len == 128) ? RT_SCOPE_HOST : RT_SCOPE_LINK;
+ req.i.rtm_scope = RT_SCOPE_UNIVERSE;
req.i.rtm_protocol = proto;
req.i.rtm_type = RTN_UNICAST;
req.i.rtm_dst_len = pref_len;
@@ -604,7 +604,7 @@ int __export ip6route_del(int ifindex, const struct in6_addr *dst, int pref_len,
req.n.nlmsg_type = RTM_DELROUTE;
req.i.rtm_family = AF_INET6;
req.i.rtm_table = RT_TABLE_MAIN;
- req.i.rtm_scope = (pref_len == 128) ? RT_SCOPE_HOST : RT_SCOPE_LINK;
+ req.i.rtm_scope = RT_SCOPE_UNIVERSE;
req.i.rtm_protocol = proto;
req.i.rtm_type = RTN_UNICAST;
req.i.rtm_dst_len = pref_len;