diff options
author | Rafael Zalamena <rzalamena@users.noreply.github.com> | 2019-06-05 16:30:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-05 16:30:19 +0200 |
commit | 9e8238f5d6afdadd72fb81d3c324c17f53b19e7a (patch) | |
tree | 716de8a9378b2d4dccb5962927244f5a45003178 /bfdd | |
parent | Merge pull request #4459 from donaldsharp/bfd_access_list_ignore (diff) | |
parent | doc: Update the documentation to reflect -N changes (diff) | |
download | frr-9e8238f5d6afdadd72fb81d3c324c17f53b19e7a.tar.xz frr-9e8238f5d6afdadd72fb81d3c324c17f53b19e7a.zip |
Merge pull request #4431 from donaldsharp/mad_gainz
Switch over to `-N FOO` adding FOO to the various directories/files we open up
Diffstat (limited to 'bfdd')
-rw-r--r-- | bfdd/bfdd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c index e26ed3376..06e01abcf 100644 --- a/bfdd/bfdd.c +++ b/bfdd/bfdd.c @@ -160,7 +160,8 @@ static void bg_init(void) int main(int argc, char *argv[]) { - const char *ctl_path = BFDD_CONTROL_SOCKET; + char ctl_path[512]; + bool ctlsockused = false; int opt; /* Initialize system sockets. */ @@ -170,6 +171,8 @@ int main(int argc, char *argv[]) frr_opt_add("", longopts, " --bfdctl Specify bfdd control socket\n"); + snprintf(ctl_path, sizeof(ctl_path), BFDD_CONTROL_SOCKET, + "", ""); while (true) { opt = frr_getopt(argc, argv, NULL); if (opt == EOF) @@ -177,7 +180,8 @@ int main(int argc, char *argv[]) switch (opt) { case OPTION_CTLSOCK: - ctl_path = optarg; + strlcpy(ctl_path, optarg, sizeof(ctl_path)); + ctlsockused = true; break; default: @@ -186,6 +190,10 @@ int main(int argc, char *argv[]) } } + if (bfdd_di.pathspace && !ctlsockused) + snprintf(ctl_path, sizeof(ctl_path), BFDD_CONTROL_SOCKET, + "/", bfdd_di.pathspace); + #if 0 /* TODO add support for JSON configuration files. */ parse_config(conf); #endif |