diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2020-12-02 17:31:40 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2020-12-02 17:33:45 +0100 |
commit | 5b9479a72807706dcbe367751f33e4157e6e4f00 (patch) | |
tree | 91b93974fe7993e8580c08c6c93615fea09a6cc6 | |
parent | fda6b702bacfa1e35ac68f2b22ad9e67b8f3dade (diff) | |
download | NetworkManager-5b9479a72807706dcbe367751f33e4157e6e4f00.tar.gz |
policy: fix hostname lookup from DNS
Fixes: 09c83871144a ('policy: use the hostname setting')
-rw-r--r-- | src/nm-policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c index d01fe40738..3eef393cdf 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -940,7 +940,7 @@ update_system_hostname(NMPolicy *self, const char *msg) if (priv->hostname_mode != NM_POLICY_HOSTNAME_MODE_DHCP) { for (IS_IPv4 = 1; IS_IPv4 >= 0; IS_IPv4--) { - const int addr_family = IS_IPv4 ? AF_INET6 : AF_INET; + const int addr_family = IS_IPv4 ? AF_INET : AF_INET6; if (info->from_dns && info->ip_x[IS_IPv4]) { const char *result; |