0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Config: Moved hostname check before any other commit is done

This was sending <none> hostname via UDP while reconfiguring.
This commit is contained in:
Maria Matejka 2024-01-28 23:03:54 +01:00
parent cd81b6d7cd
commit b7400f73a4

View File

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