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/dns | |
| 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/dns')
| -rw-r--r-- | src/dns/nm-dns-dnsmasq.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dns/nm-dns-dnsmasq.c b/src/dns/nm-dns-dnsmasq.c index cb311dffda..3ec1fd2de8 100644 --- a/src/dns/nm-dns-dnsmasq.c +++ b/src/dns/nm-dns-dnsmasq.c @@ -91,8 +91,10 @@ get_ip4_rdns_domains (NMIP4Config *ip4) nm_ip_config_iter_ip4_address_for_each (&ipconf_iter, ip4, &address) nm_utils_get_reverse_dns_domains_ip4 (address->address, address->plen, domains); - nm_ip_config_iter_ip4_route_for_each (&ipconf_iter, ip4, &route) - nm_utils_get_reverse_dns_domains_ip4 (route->network, route->plen, domains); + nm_ip_config_iter_ip4_route_for_each (&ipconf_iter, ip4, &route) { + if (!NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)) + nm_utils_get_reverse_dns_domains_ip4 (route->network, route->plen, domains); + } /* Terminating NULL so we can use g_strfreev() to free it */ g_ptr_array_add (domains, NULL); @@ -119,8 +121,10 @@ get_ip6_rdns_domains (NMIP6Config *ip6) nm_ip_config_iter_ip6_address_for_each (&ipconf_iter, ip6, &address) nm_utils_get_reverse_dns_domains_ip6 (&address->address, address->plen, domains); - nm_ip_config_iter_ip6_route_for_each (&ipconf_iter, ip6, &route) - nm_utils_get_reverse_dns_domains_ip6 (&route->network, route->plen, domains); + nm_ip_config_iter_ip6_route_for_each (&ipconf_iter, ip6, &route) { + if (!NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)) + nm_utils_get_reverse_dns_domains_ip6 (&route->network, route->plen, domains); + } /* Terminating NULL so we can use g_strfreev() to free it */ g_ptr_array_add (domains, NULL); |
