summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2022-01-20 15:25:50 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2022-01-26 14:54:52 +0100
commitddaee5d7e6bff2aaa48d0a595805ce6d3f5cd493 (patch)
tree6da7a14a749c76b9112e6bcea22df4822caff868
parentcb29244552af69ba0d59db0bdcd98e145bb3da97 (diff)
downloadNetworkManager-ddaee5d7e6bff2aaa48d0a595805ce6d3f5cd493.tar.gz
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.
-rw-r--r--src/core/nm-policy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c
index dcb951af4d..cb5b543e9d 100644
--- a/src/core/nm-policy.c
+++ b/src/core/nm-policy.c
@@ -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 *