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.
This commit is contained in:
Thomas Haller 2022-10-27 19:48:41 +02:00
parent da29726b07
commit 72e92e0a2b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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);