};
/* CTL Socket path */
-char ctl_sock_path[MAXPATHLEN] = LDPD_SOCKET;
+char ctl_sock_path[MAXPATHLEN];
/* LDPd options. */
#define OPTION_CTLSOCK 1001
* and build a new configuartion from scratch.
*/
ldp_config_reset(vty_conf);
- vty_read_config(ldpd_di.config_file, config_default);
+ vty_read_config(NULL, ldpd_di.config_file, config_default);
ldp_config_apply(NULL, vty_conf);
}
}
};
+static const struct frr_yang_module_info *ldpd_yang_modules[] = {
+};
+
FRR_DAEMON_INFO(ldpd, LDP,
.vty_port = LDP_VTY_PORT,
.n_signals = array_size(ldp_signals),
.privs = &ldpd_privs,
+
+ .yang_modules = ldpd_yang_modules,
+ .n_yang_modules = array_size(ldpd_yang_modules),
)
static int ldp_config_fork_apply(struct thread *t)
int pipe_parent2lde[2], pipe_parent2lde_sync[2];
char *ctl_sock_name;
struct thread *thread = NULL;
+ bool ctl_sock_used = false;
+
+ snprintf(ctl_sock_path, sizeof(ctl_sock_path), LDPD_SOCKET,
+ "", "");
ldpd_process = PROC_MAIN;
log_procname = log_procnames[ldpd_process];
" --ctl_socket Override ctl socket path\n"
" -n, --instance Instance id\n");
+ /* set default instance (to differentiate ldpd socket from lde one */
+ init.instance = 1;
+
while (1) {
int opt;
case 0:
break;
case OPTION_CTLSOCK:
+ ctl_sock_used = true;
ctl_sock_name = strrchr(LDPD_SOCKET, '/');
if (ctl_sock_name)
/* skip '/' */
}
}
+ if (ldpd_di.pathspace && !ctl_sock_used)
+ snprintf(ctl_sock_path, sizeof(ctl_sock_path), LDPD_SOCKET,
+ "/", ldpd_di.pathspace);
+
strlcpy(init.user, ldpd_privs.user, sizeof(init.user));
strlcpy(init.group, ldpd_privs.group, sizeof(init.group));
strlcpy(init.ctl_sock_path, ctl_sock_path, sizeof(init.ctl_sock_path));
master = frr_init();
- vty_config_lockless();
vrf_init(NULL, NULL, NULL, NULL, NULL);
access_list_init();
ldp_vty_init();
if (errno == EINTR)
continue;
/* No more processes were found. */
- if (errno != ECHILD)
+ if (errno == ECHILD)
break;
/* Unhandled errno condition. */