policy: fix hostname lookup from DNS

Fixes: 09c8387114 ('policy: use the hostname setting')
This commit is contained in:
Beniamino Galvani 2020-12-02 17:31:40 +01:00
parent fda6b702ba
commit 5b9479a728

View file

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