summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-11-23 15:18:44 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-11-23 15:20:13 +0100
commitcc90c54b36818a13774edfed8d7ac9a6e36c9373 (patch)
treeeaffcbfa386a03cc25b0e47979c8956f204cb6a4 /lib/zclient.c
parenta13d2933b755e159f78251d6a790eb153c6500fb (diff)
*: add `zclient_options_sync`
... and use it instead of fiddling with the `.synchronous` field. (Make it const while at it.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 39756933e7..61533aecc6 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -41,10 +41,14 @@ static void zclient_event(enum zclient_event, struct zclient *);
static void zebra_interface_if_set_value(struct stream *s,
struct interface *ifp);
-struct zclient_options zclient_options_default = {
+const struct zclient_options zclient_options_default = {
.synchronous = false,
};
+const struct zclient_options zclient_options_sync = {
+ .synchronous = true,
+};
+
struct sockaddr_storage zclient_addr;
socklen_t zclient_addr_len;
@@ -53,7 +57,7 @@ static int zclient_debug;
/* Allocate zclient structure. */
struct zclient *zclient_new(struct event_loop *master,
- struct zclient_options *opt,
+ const struct zclient_options *opt,
zclient_handler *const *handlers, size_t n_handlers)
{
struct zclient *zclient;