summaryrefslogtreecommitdiff
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-11-23 15:40:38 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-11-23 15:42:59 +0100
commit5a40f2b0e75bbb43c0d6e2f9cfe190dfaa61f386 (patch)
tree0474bf802a46f54f4170e40b8829b271906a4879 /lib/zclient.h
parentcc90c54b36818a13774edfed8d7ac9a6e36c9373 (diff)
lib, bgp/vnc: add `.auxiliary` zclient option
Avoids calling VRF/interface/... handlers in library code more than once. It's kinda surprising that this hasn't been blowing up already for the VNC code, luckily these handlers are (mostly?) idempotent. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index c8dff18bb9..05eb6b20ee 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -306,6 +306,11 @@ struct zclient {
/* Is this a synchronous client? */
bool synchronous;
+ /* Auxiliary clients don't execute standard library handlers
+ * (which otherwise would duplicate VRF/interface add/delete/etc.
+ */
+ bool auxiliary;
+
/* BFD enabled with bfd_protocol_integration_init() */
bool bfd_integration;
@@ -832,10 +837,17 @@ enum zebra_neigh_state { ZEBRA_NEIGH_INACTIVE = 0, ZEBRA_NEIGH_ACTIVE = 1 };
struct zclient_options {
bool synchronous;
+
+ /* auxiliary = don't call common lib/ handlers that manage bits.
+ * Those should only run once, on the "main" zclient, which this is
+ * not. (This is also set for synchronous clients.)
+ */
+ bool auxiliary;
};
extern const struct zclient_options zclient_options_default;
extern const struct zclient_options zclient_options_sync;
+extern const struct zclient_options zclient_options_auxiliary;
/* link layer representation for GRE like interfaces
* ip_in is the underlay IP, ip_out is the tunnel dest