summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bfdd/bfd.h2
-rw-r--r--bfdd/bfdd.c7
-rw-r--r--bfdd/control.c6
-rw-r--r--configure.ac1
-rw-r--r--doc/user/bfd.rst4
5 files changed, 8 insertions, 12 deletions
diff --git a/bfdd/bfd.h b/bfdd/bfd.h
index 26bd20b5d..66bf70680 100644
--- a/bfdd/bfd.h
+++ b/bfdd/bfd.h
@@ -32,6 +32,8 @@ DECLARE_MGROUP(BFDD);
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
diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c
index 71055c32e..731ca6f87 100644
--- a/bfdd/bfdd.c
+++ b/bfdd/bfdd.c
@@ -335,8 +335,6 @@ int main(int argc, char *argv[])
" --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)
@@ -357,9 +355,8 @@ int main(int argc, char *argv[])
}
}
- 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();
diff --git a/bfdd/control.c b/bfdd/control.c
index 6ff86f291..98fd813ef 100644
--- a/bfdd/control.c
+++ b/bfdd/control.c
@@ -95,11 +95,11 @@ int control_init(const char *path)
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);
diff --git a/configure.ac b/configure.ac
index f5ecd4cde..c9e202f87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2738,7 +2738,6 @@ AC_DEFINE_UNQUOTED([WATCHFRR_SH_PATH], ["${CFG_SBIN%/}/watchfrr.sh"], [path to w
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])
diff --git a/doc/user/bfd.rst b/doc/user/bfd.rst
index 6915885f4..3ca104a3a 100644
--- a/doc/user/bfd.rst
+++ b/doc/user/bfd.rst
@@ -46,9 +46,7 @@ may also be specified (:ref:`common-invocation-options`).
/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