};
/* CTL Socket path */
-char ctl_sock_path[MAXPATHLEN] = LDPD_SOCKET;
+char ctl_sock_path[MAXPATHLEN];
/* LDPd options. */
#define OPTION_CTLSOCK 1001
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. */