netlink: fix rtnl_route_alloc_cache() call
Same fix as in commit 195a09d7c0
.
NL_AUTO_PROVIDE is not a valid flag for this call and it's coincidental
with ROUTE_CACHE_CONTENT, which is not what we want.
One result arising from this fix is that per-device routes are now
assigned priorities correctly. This means, for instance, you can have a
wired and wireless connection on the same network, and have the wired
connection always take precedence whilst it's available.
Signed-off-by: Michael Chapman <mike@very.puzzling.org>
This commit is contained in:
@@ -462,7 +462,7 @@ nm_netlink_foreach_route (int ifindex,
|
||||
info.user_data = user_data;
|
||||
info.iface = nm_netlink_index_to_iface (ifindex);
|
||||
|
||||
rtnl_route_alloc_cache (nm_netlink_get_default_handle (), family, NL_AUTO_PROVIDE, &cache);
|
||||
rtnl_route_alloc_cache (nm_netlink_get_default_handle (), family, 0, &cache);
|
||||
g_warn_if_fail (cache != NULL);
|
||||
if (cache) {
|
||||
nl_cache_foreach (cache, foreach_route_cb, &info);
|
||||
|
Reference in New Issue
Block a user