// TODO: hack, remove once all global variables are gone.
static void set_mesh(meshlink_handle_t *localmesh) {
mesh = localmesh;
// TODO: hack, remove once all global variables are gone.
static void set_mesh(meshlink_handle_t *localmesh) {
mesh = localmesh;
meshlink_handle_t *mesh = xzalloc(sizeof *mesh);
mesh->confbase = xstrdup(confbase);
mesh->name = xstrdup(name);
meshlink_handle_t *mesh = xzalloc(sizeof *mesh);
mesh->confbase = xstrdup(confbase);
mesh->name = xstrdup(name);
logger(DEBUG_ALWAYS, LOG_NOTICE, "Terminating");
exit_configuration(&mesh->config);
logger(DEBUG_ALWAYS, LOG_NOTICE, "Terminating");
exit_configuration(&mesh->config);