core: update hostname once at startup

NMPolicy stores the last hostname set in priv->cur_hostname and checks
if it changed before notifying the DNS manager.

_set_hostname() should be called one time early during startup so that
the priv->cur_hostname gets initialized without triggering a DNS
update.
This commit is contained in:
Beniamino Galvani 2022-01-20 15:25:50 +01:00
parent cb29244552
commit ddaee5d7e6

View file

@ -2820,6 +2820,7 @@ constructed(GObject *object)
G_OBJECT_CLASS(nm_policy_parent_class)->constructed(object);
_LOGD(LOGD_DNS, "hostname-mode: %s", _hostname_mode_to_string(priv->hostname_mode));
update_system_hostname(self, "initial hostname");
}
NMPolicy *