]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: nuke `BFDD_CONTROL_SOCKET`
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 24 Jan 2024 20:38:18 +0000 (21:38 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 27 Jan 2024 18:01:19 +0000 (19:01 +0100)
This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bfdd/bfd.h
bfdd/bfdd.c
bfdd/control.c
configure.ac
doc/user/bfd.rst

index 26bd20b5d7ab8eb8456e49d92ff61a48503fd976..66bf706808428801b939aa3127978e3e3a8dee10 100644 (file)
@@ -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
index 71055c32ed65dede72914b984486e6d37b6e44d7..731ca6f875d7ddeccce1bf3889b22bfe6cddacef 100644 (file)
@@ -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();
index 6ff86f29135422400c5e4f73159642b733391086..98fd813ef7216668a4360b473f07e33cffbd36d7 100644 (file)
@@ -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);
index f5ecd4cde4cae70a33d1d28e695c0805f292adb2..c9e202f870caccf10e34a3ca7ff1444407790f78 100644 (file)
@@ -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])
index 6915885f45ce5c50d0d5f774277f48418f10ec38..3ca104a3a93e8d897907555b1326517e389c350c 100644 (file)
@@ -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