From b7400f73a47b220378ef4bd1923d09f19cf7ffbd Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sun, 28 Jan 2024 23:03:54 +0100 Subject: [PATCH] Config: Moved hostname check before any other commit is done This was sending hostname via UDP while reconfiguring. --- conf/conf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/conf.c b/conf/conf.c index c17358c1..c5ce6f5a 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -246,14 +246,6 @@ config_del_obstacle(struct config *c) static int global_commit(struct config *new, struct config *old) { - if (!new->hostname) - { - new->hostname = get_hostname(new->mem); - - if (!new->hostname) - log(L_WARN "Cannot determine hostname"); - } - if (!old) return 0; @@ -289,6 +281,14 @@ config_do_commit(struct config *c, int type) old_cftype = type; config = c; + if (!c->hostname) + { + c->hostname = get_hostname(c->mem); + + if (!c->hostname) + log(L_WARN "Cannot determine hostname"); + } + configuring = 1; if (old_config && !config->shutdown) log(L_INFO "Reconfiguring");