This just unnecessarily complicates things by involving autoconf.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
DECLARE_MTYPE(BFDD_CONTROL);
DECLARE_MTYPE(BFDD_NOTIFICATION);
+#define BFDD_SOCK_NAME "%s/bfdd.sock", frr_runstatedir
+
/* bfd Authentication Type. */
#define BFD_AUTH_NULL 0
#define BFD_AUTH_SIMPLE 1
" --bfdctl Specify bfdd control socket\n"
" --dplaneaddr Specify BFD data plane address\n");
- snprintf(ctl_path, sizeof(ctl_path), BFDD_CONTROL_SOCKET,
- "", "");
while (true) {
opt = frr_getopt(argc, argv, NULL);
if (opt == EOF)
}
}
- if (bfdd_di.pathspace && !ctlsockused)
- snprintf(ctl_path, sizeof(ctl_path), BFDD_CONTROL_SOCKET,
- "/", bfdd_di.pathspace);
+ if (!ctlsockused)
+ snprintf(ctl_path, sizeof(ctl_path), BFDD_SOCK_NAME);
/* Initialize FRR infrastructure. */
master = frr_init();
mode_t umval;
struct sockaddr_un sun_ = {
.sun_family = AF_UNIX,
- .sun_path = BFDD_CONTROL_SOCKET,
};
- if (path)
- strlcpy(sun_.sun_path, path, sizeof(sun_.sun_path));
+ assert(path);
+
+ strlcpy(sun_.sun_path, path, sizeof(sun_.sun_path));
/* Remove previously created sockets. */
unlink(sun_.sun_path);
AC_DEFINE_UNQUOTED([LDPD_SOCKET], ["$CFG_STATE%s%s/ldpd.sock"], [ldpd control socket])
AC_DEFINE_UNQUOTED([ZEBRA_SERV_PATH], ["$CFG_STATE%s%s/zserv.api"], [zebra api socket])
-AC_DEFINE_UNQUOTED([BFDD_CONTROL_SOCKET], ["$CFG_STATE%s%s/bfdd.sock"], [bfdd control socket])
AC_DEFINE_UNQUOTED([OSPFD_GR_STATE], ["$CFG_STATE%s/ospfd-gr.json"], [ospfd GR state information])
AC_DEFINE_UNQUOTED([OSPF6D_GR_STATE], ["$CFG_STATE/ospf6d-gr.json"], [ospf6d GR state information])
AC_DEFINE_UNQUOTED([ISISD_RESTART], ["$CFG_STATE%s/isid-restart.json"], [isisd restart information])
/usr/lib/frr/bfdd --bfdctl /tmp/bfdd.sock
- The default UNIX socket location is:
-
- #define BFDD_CONTROL_SOCKET "|INSTALL_PREFIX_STATE|/bfdd.sock"
+ The default UNIX socket location is |INSTALL_PREFIX_STATE|/bfdd.sock
This option overrides the location addition that the -N option provides
to the bfdd.sock