Skip to content

Commit

Permalink
build: nuke BFDD_CONTROL_SOCKET
Browse files Browse the repository at this point in the history
This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Jan 27, 2024
1 parent 0d5a249 commit 80b6787
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 2 additions & 0 deletions bfdd/bfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions bfdd/bfdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions bfdd/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 1 addition & 3 deletions doc/user/bfd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80b6787

Please sign in to comment.