summaryrefslogtreecommitdiff
path: root/mgmtd
diff options
context:
space:
mode:
authorIgor Ryzhov <idryzhov@gmail.com>2024-12-27 21:33:39 +0200
committerIgor Ryzhov <idryzhov@gmail.com>2025-01-15 23:38:27 +0200
commit300f8dbda4bc7efdab90809fbff5f9799c0ec2aa (patch)
tree72a4cdba181d9c90528f098d41dee08e862d2b6c /mgmtd
parent6f214d97d1a7883ea8d5866e10db31daffa0325a (diff)
lib: introduce global -w option for VRF netns backend
Current -n option is only for zebra and mgmtd. All other daemons receive the VRF backend configuration from zebra upon connection to it. This leads to a potential race condition - daemons need to know the backend before they start reading their config, but they can be not connected to zebra yet at this point. As the VRF backend cannot change during runtime, let's introduce a new global -w option for setting netns backend, to make sure that all daemons know their VRF backend immediately after start. The reason for introducing a new option instead of making -n global is that ospfd already uses -n for another purposes. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
Diffstat (limited to 'mgmtd')
-rw-r--r--mgmtd/mgmt_main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mgmtd/mgmt_main.c b/mgmtd/mgmt_main.c
index 7d909446c3..e3fc6b7f29 100644
--- a/mgmtd/mgmt_main.c
+++ b/mgmtd/mgmt_main.c
@@ -238,10 +238,9 @@ int main(int argc, char **argv)
int buffer_size = MGMTD_SOCKET_BUF_SIZE;
frr_preinit(&mgmtd_di, argc, argv);
- frr_opt_add(
- "s:n" DEPRECATED_OPTIONS, longopts,
- " -s, --socket_size Set MGMTD peer socket send buffer size\n"
- " -n, --vrfwnetns Use NetNS as VRF backend\n");
+ frr_opt_add("s:n" DEPRECATED_OPTIONS, longopts,
+ " -s, --socket_size Set MGMTD peer socket send buffer size\n"
+ " -n, --vrfwnetns Use NetNS as VRF backend (deprecated, use -w)\n");
/* Command line argument treatment. */
while (1) {
@@ -264,6 +263,8 @@ int main(int argc, char **argv)
buffer_size = atoi(optarg);
break;
case 'n':
+ fprintf(stderr,
+ "The -n option is deprecated, please use global -w option instead.\n");
vrf_configure_backend(VRF_BACKEND_NETNS);
break;
default: