diff options
author | Thomas Haller <thaller@redhat.com> | 2017-08-31 13:39:04 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-09-08 11:11:21 +0200 |
commit | 0918b4914d03ec14f71b3e56178c44a6ec648b34 (patch) | |
tree | caea55c278b80dff68ab754fb1a65351ae9695b4 /src/nm-pacrunner-manager.c | |
parent | a214f398e7b17cacad335f70462a606affc2ad63 (diff) | |
download | NetworkManager-0918b4914d03ec14f71b3e56178c44a6ec648b34.tar.gz |
core: support tracking default-route in NMIP4Config/NMIP6Config
Default-routes are for the most part like regular routes. Add support to
track them like regular routes in NMIP4Config/NMIP6Config.
One thing is, sometimes we need to figure out whether an ip-config
instance has a default-route. For that, keep track of the best
default-route (there might be multiple) and expose it. That is
the most complicated part of this patch, because there are so many
places where the list of routes gets modified (replace, intersect,
subtract, merge, add), and they all need to take care of updating
the best default-route.
In a next patch, NMDefaultRouteManager will be dropped and default-routes
will be tracked by NMIP4Config/NMIP6Config.
Diffstat (limited to 'src/nm-pacrunner-manager.c')
-rw-r--r-- | src/nm-pacrunner-manager.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nm-pacrunner-manager.c b/src/nm-pacrunner-manager.c index 2558ca0f30..08e10e40db 100644 --- a/src/nm-pacrunner-manager.c +++ b/src/nm-pacrunner-manager.c @@ -192,6 +192,8 @@ get_ip4_domains (GPtrArray *domains, NMIP4Config *ip4) } nm_ip_config_iter_ip4_route_for_each (&ipconf_iter, ip4, &routes) { + if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (routes)) + continue; cidr = g_strdup_printf ("%s/%u", nm_utils_inet4_ntop (routes->network, NULL), routes->plen); @@ -225,6 +227,8 @@ get_ip6_domains (GPtrArray *domains, NMIP6Config *ip6) } nm_ip_config_iter_ip6_route_for_each (&ipconf_iter, ip6, &routes) { + if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (routes)) + continue; cidr = g_strdup_printf ("%s/%u", nm_utils_inet6_ntop (&routes->network, NULL), routes->plen); |