diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2024-01-24 21:38:18 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2024-01-27 19:01:19 +0100 |
| commit | 80b6787e272388e781695ae17ae26b4c7148d5fc (patch) | |
| tree | 19a11073c280375e66d2de09e74dc37343f2407c /bfdd | |
| parent | 0d5a2497ca56d98e9af9d337a9b9d208e8b3bfcb (diff) | |
build: nuke `BFDD_CONTROL_SOCKET`
This just unnecessarily complicates things by involving autoconf.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bfdd')
| -rw-r--r-- | bfdd/bfd.h | 2 | ||||
| -rw-r--r-- | bfdd/bfdd.c | 7 | ||||
| -rw-r--r-- | bfdd/control.c | 6 |
3 files changed, 7 insertions, 8 deletions
diff --git a/bfdd/bfd.h b/bfdd/bfd.h index 26bd20b5d7..66bf706808 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 71055c32ed..731ca6f875 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 6ff86f2913..98fd813ef7 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); |
