]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add some documentation on when zserv_open should be used
authorDonald Sharp <sharpd@nvidia.com>
Wed, 15 Jan 2025 18:03:52 +0000 (13:03 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 6 Feb 2025 16:16:48 +0000 (16:16 +0000)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 4b967527376db4f08c50f9c32cc77556700d0eec)

zebra/zserv.c
zebra/zserv.h

index 7ef358232991eb06972dd018eaa832bb785ee6ea..6965c285cdc09beaeb7fde4688256725e050ff5c 100644 (file)
@@ -937,6 +937,10 @@ void zserv_close(void)
 /*
  * Open zebra's ZAPI listener socket. This is done early during startup,
  * before zebra is ready to listen and accept client connections.
+ *
+ * This function should only ever be called from the startup pthread
+ * from main.c.  If it is called multiple times it will cause problems
+ * because it causes the zsock global variable to be setup.
  */
 void zserv_open(const char *path)
 {
index ce47ef19fa36053bc6d064164829d804a082713c..1ff7ccd9810c2810cbce7231a8167a2df1c69033 100644 (file)
@@ -262,6 +262,9 @@ extern void zserv_close(void);
  *
  * path
  *    where to place the Unix domain socket
+ *
+ * This function *should* only ever be called from
+ * main() and only every from 1 pthread.
  */
 extern void zserv_open(const char *path);