From 72e92e0a2b98b8a0f0582fdb9f2ef237c4c9d6fe Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 27 Oct 2022 19:48:41 +0200 Subject: [PATCH] policy: skip external devices in build_device_hostname_infos() We soon will handle loopback, so -- if no loopback profile is activated in NetworkManager -- we will have an externally managed profile on loopback. This messes up the result. In general, external connections don't make much sense for build_device_hostname_infos(). Ignore them. --- src/core/nm-policy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c index ec03616a1b..3d310b409a 100644 --- a/src/core/nm-policy.c +++ b/src/core/nm-policy.c @@ -738,6 +738,9 @@ build_device_hostname_infos(NMPolicy *self) if (!device) continue; + if (nm_device_sys_iface_state_is_external(device)) + continue; + only_from_default = device_get_hostname_property_boolean(device, NM_SETTING_HOSTNAME_ONLY_FROM_DEFAULT);