Add "scope link" when adding routes without a nexthop.
This is consistent with what /sbin/ip does, and it makes
recursive lookups on secondary tables work even when the main
table is empty.
This was originally proposed by Sreeram as http://ag/506456 to
fix a VPN issue, but then abandoned because it did not fix that
particular problem.
Bug: 16628572
Change-Id: I85753389c683ae2127b21af722463a35a33b60eb
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index 355326d..943a4c1 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -388,6 +388,7 @@
.rtm_type = type,
.rtm_family = family,
.rtm_dst_len = prefixLength,
+ .rtm_scope = static_cast<uint8_t>(nexthop ? RT_SCOPE_UNIVERSE : RT_SCOPE_LINK),
};
rtattr rtaDst = { U16_RTA_LENGTH(rawLength), RTA_DST };