Skip to content

Double conf_init in case of config reload: is it needed? #62

@fzs

Description

@fzs

mdnsd/src/mdnsd.c

Lines 432 to 440 in 4570d3e

if (reload) {
sys_init();
for (iface = iface_iterator(1); iface; iface = iface_iterator(0)) {
records_clear(iface->mdns);
conf_init(iface, path, hostnm);
}
pidfile(PACKAGE_NAME);
reload = 0;
}

Why does this reload case do a sys_init (which runs conf_init on each interface), and then removes all records and calls a conf_init again on every interface? I am a bit confused as to why this is necessary.

Unfortunately neither the commit nor the PR introducing the records_clear has any information as to why removing all records is necessary. But if it is, then does this really need to happen in two loops over the interfaces? Wouldn't the records_clear rather have to be in sys_init or conf_init? It is initialization, after all (according to the name).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions