NetworkManager/src
Thomas Haller 44ebb99cfa
dns: detect support of systemd-resolved's SetLinkDefaultRoute() and avoid it
We now always use SetLinkDefaultRoute(), but that API was only added in
systemd v240 ([1]).

We could just always call the non-existing method, and ignore the
error. However, that feels ugly. Would systemd-resolved log warnings
about that? Should we suppress all messages about that failure (not
good for debugging).

Instead, make an effort to detect support of the function, and avoid
calling it. That is significantly more complicated than just always
calling the method and not care.

Note that even if systemd-resolved does not support SetLinkDefaultRoute(),
we cannot do anything smart about that. We would simply rely on
systemd-resolved (hopefully) doing the right thing automatically.
That's better and simpler than explicitly adding a "~." domain in
the fallback case.

Also, detecting support is straight forward in the common case, where
there is either success or a clear "org.freedesktop.DBus.Error.UnknownMethod"
error. In cases where there is any other failure, we don't really know.
In that case, we keep trying to use the API under the assumption that
it should work.

[1] https://github.com/systemd/systemd/commit/7 ## 7673795dcf5797491e7f785cbf5077d29a15db4
2020-11-27 10:46:42 +01:00
..
devices veth: add support to configure veth interfaces 2020-11-27 10:12:36 +01:00
dhcp all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
dns dns: detect support of systemd-resolved's SetLinkDefaultRoute() and avoid it 2020-11-27 10:46:42 +01:00
dnsmasq all: drop unnecessary cast for return value of g_object_new() 2020-11-12 16:03:09 +01:00
initrd initrd: fix parsing of ip= arguments with empty first token 2020-11-26 17:41:40 +01:00
ndisc all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
platform platform: rework nm_platform_dedup_multi_iter_next_*() and add more implementations 2020-11-24 08:52:58 +01:00
ppp ppp: drop unnecessary cast for return value of g_object_new() (manually) 2020-11-12 16:08:17 +01:00
settings all: add hostname setting 2020-11-16 16:43:39 +01:00
supplicant wifi: use NMEtherAddr struct for bssid 2020-11-19 20:17:03 +01:00
systemd systemd: merge branch systemd into master 2020-10-08 10:42:27 +02:00
tests core/trivial: rename nm_utils_get_reverse_dns_domains_ip*() functions 2020-11-24 08:52:59 +01:00
vpn all: drop unnecessary cast for return value of g_object_new() 2020-11-12 16:03:09 +01:00
main-utils.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
main-utils.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
main.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
meson.build l3cfg: add support for IPv4 link local addresses (ipv4ll) to NML3Cfg 2020-10-23 17:11:57 +02:00
NetworkManagerUtils.c core: cleanup IPv4/IPv6 checks using NM_IS_IPv4() 2020-10-30 16:52:59 +01:00
NetworkManagerUtils.h core: add nm_utils_share_rules_add_all_rules() for constructing iptables rules 2020-10-27 17:40:19 +01:00
nm-act-request.c all: drop unnecessary cast for return value of g_object_new() 2020-11-12 16:03:09 +01:00
nm-act-request.h core: refactor tracking of shared-rules to use NMUtilsShareRules 2020-10-27 17:40:19 +01:00
nm-active-connection.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-active-connection.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-audit-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-audit-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-auth-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-auth-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-auth-utils.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-auth-utils.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-checkpoint-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-checkpoint-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-checkpoint.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-checkpoint.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-config-data.c all/trivial: rename _nm_utils_strv_equal()/_nm_utils_strv_cmp_n() to have no leading underscore 2020-10-12 22:18:26 +02:00
nm-config-data.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-config.c core: recognize "wifi.scan-generate-mac-address-mask" as valid "NetworkManager.conf" option 2020-11-27 09:55:01 +01:00
nm-config.h core: recognize "wifi.scan-generate-mac-address-mask" as valid "NetworkManager.conf" option 2020-11-27 09:55:01 +01:00
nm-connectivity.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-connectivity.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-core-utils.c core/trivial: rename nm_utils_get_reverse_dns_domains_ip*() functions 2020-11-24 08:52:59 +01:00
nm-core-utils.h core: add nm_utils_get_reverse_dns_domains_ip() helper 2020-11-24 08:52:59 +01:00
nm-dbus-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dbus-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dbus-object.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dbus-object.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dbus-utils.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dbus-utils.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dcb.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dcb.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dhcp-config.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dhcp-config.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dispatcher.c core/dispatcher: merge dump[46]_ip_to_props() for IPv4/IPv6 2020-10-30 11:58:46 +01:00
nm-dispatcher.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-firewall-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-firewall-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-hostname-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-hostname-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-iface-helper.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-ip-config.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-ip-config.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-ip4-config.c all: drop unnecessary cast for return value of g_object_new() 2020-11-12 16:03:09 +01:00
nm-ip4-config.h core: add nm_ip_config_is_ipv4() for dispatching NMIP[46]Config operations 2020-11-24 08:53:00 +01:00
nm-ip6-config.c all: drop unnecessary cast for return value of g_object_new() 2020-11-12 16:03:09 +01:00
nm-ip6-config.h core: add never-default field to NMIP{4,6}Config 2020-10-09 10:29:00 +02:00
nm-keep-alive.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-keep-alive.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-l3-config-data.c core: cleanup IPv4/IPv6 checks using NM_IS_IPv4() 2020-10-30 16:52:59 +01:00
nm-l3-config-data.h core: cleanup IPv4/IPv6 checks using NM_IS_IPv4() 2020-10-30 16:52:59 +01:00
nm-l3-ipv4ll.c l3cfg: let NML3Cfg return a singleton NML3IPv4LL instance 2020-10-27 17:04:20 +01:00
nm-l3-ipv4ll.h l3cfg: add nm_l3_ipv4ll_is_timed_out() for letting IPv4LL reach a failed state 2020-10-27 17:04:20 +01:00
nm-l3cfg.c core: cleanup IPv4/IPv6 checks using NM_IS_IPv4() 2020-10-30 16:52:59 +01:00
nm-l3cfg.h l3cfg: let NML3Cfg return a singleton NML3IPv4LL instance 2020-10-27 17:04:20 +01:00
nm-logging.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-logging.h shared,all: introduce and use LOGD_IPX()/LOGD_DHCPX() macros 2020-10-30 12:38:31 +01:00
nm-manager.c core: fix modifying connection during recheck_assume_connection() 2020-11-24 08:49:21 +01:00
nm-manager.h core: reverse the order of active connections in the manager 2020-11-16 16:43:39 +01:00
nm-netns.c core: use nm_clear_pointer() instead of g_clear_pointer() 2020-10-28 13:59:22 +01:00
nm-netns.h l3cfg: add nm_netns_get_l3cfg() accessor 2020-10-23 17:11:54 +02:00
nm-pacrunner-manager.c core: use nm_ip_config_iter_ip_address_for_each() in "nm-pacrunner-manager.c" 2020-11-24 08:52:59 +01:00
nm-pacrunner-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-policy.c dns: fix _dns_manager_set_ip_config() for missing device 2020-11-19 09:25:02 +01:00
nm-policy.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-proxy-config.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-proxy-config.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-rfkill-manager.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-rfkill-manager.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-session-monitor.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-session-monitor.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-sleep-monitor.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-sleep-monitor.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-test-utils-core.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-types.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
org.freedesktop.NetworkManager.conf dbus: pretty format "org.freedesktop.NetworkManager.conf" 2020-04-15 19:17:00 +02:00