mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 14:50:10 +01:00
device: fix assertion failure when resolving hostname
nm_device_get_effective_ip_config_method() must called only on a
device with an applied connection. Fix assertion failure [1]:
nm_device_get_effective_ip_config_method: assertion 'NM_IS_CONNECTION(connection)' failed
[1] http://faf.lab.eng.brq.redhat.com/faf/reports/20217/
Fixes: 09c8387114 ('policy: use the hostname setting'):
This commit is contained in:
parent
4e997d1b36
commit
9c516a497e
1 changed files with 5 additions and 0 deletions
|
|
@ -17657,6 +17657,11 @@ nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean
|
|||
|
||||
/* If the device is not supposed to have addresses,
|
||||
* return an immediate empty result.*/
|
||||
if (!nm_device_get_applied_connection(self)) {
|
||||
NM_SET_OUT(out_wait, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
method = nm_device_get_effective_ip_config_method(self, addr_family);
|
||||
if (IS_IPv4) {
|
||||
if (NM_IN_STRSET(method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue