From 3a9dc9c133f5bb1c35d749746e2b73be99ee91fa Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 8 Nov 2013 14:26:34 +0100 Subject: [PATCH] lldpd: tell `lldpcli` to use the appropriate control socket When using a non-default control socket, lldpd was not providing the appropriate name to lldpcli which was then not able to configure lldpd during startup. This fixes #48. --- src/daemon/lldpd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index fb91fd38..2c143cd4 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1102,7 +1102,7 @@ lldpd_exit(struct lldpd *cfg) * @return PID of running lldpcli or -1 if error. */ static pid_t -lldpd_configure(int debug, const char *path) +lldpd_configure(int debug, const char *path, const char *ctlname) { pid_t lldpcli = fork(); int devnull; @@ -1125,6 +1125,7 @@ lldpd_configure(int debug, const char *path) log_debug("main", "invoke %s %s", path, sdebug); if (execl(path, "lldpcli", sdebug, + "-u", ctlname, "-c", SYSCONFDIR "/lldpd.conf", "-c", SYSCONFDIR "/lldpd.d", "resume", @@ -1448,7 +1449,7 @@ lldpd_main(int argc, char *argv[], char *envp[]) /* Configuration with lldpcli */ if (lldpcli) { log_debug("main", "invoking lldpcli for configuration"); - if (lldpd_configure(debug, lldpcli) == -1) + if (lldpd_configure(debug, lldpcli, ctlname) == -1) fatal("main", "unable to spawn lldpcli"); } -- 2.39.5