From: Vincent Bernat Date: Fri, 8 Nov 2013 13:26:34 +0000 (+0100) Subject: lldpd: tell `lldpcli` to use the appropriate control socket X-Git-Tag: 0.7.7~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a9dc9c133f5bb1c35d749746e2b73be99ee91fa;p=thirdparty%2Flldpd.git 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. --- 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"); }