diff options
Diffstat (limited to 'lib/northbound_confd.c')
| -rw-r--r-- | lib/northbound_confd.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/lib/northbound_confd.c b/lib/northbound_confd.c index 76af494e30..e62a83cee2 100644 --- a/lib/northbound_confd.c +++ b/lib/northbound_confd.c @@ -425,8 +425,7 @@ static int frr_confd_cdb_read_cb(struct thread *thread) int *subp = NULL; int reslen = 0; - thread = NULL; - thread_add_read(master, frr_confd_cdb_read_cb, NULL, fd, &thread); + thread_add_read(master, frr_confd_cdb_read_cb, NULL, fd, &t_cdb_sub); if (cdb_read_subscription_socket2(fd, &cdb_ev, &flags, &subp, &reslen) != CONFD_OK) { @@ -1164,15 +1163,10 @@ exit: } -static int frr_confd_dp_read(struct thread *thread) +static int frr_confd_dp_read(struct confd_daemon_ctx *dctx, int fd) { - struct confd_daemon_ctx *dctx = THREAD_ARG(thread); - int fd = THREAD_FD(thread); int ret; - thread = NULL; - thread_add_read(master, frr_confd_dp_read, dctx, fd, &thread); - ret = confd_fd_ready(dctx, fd); if (ret == CONFD_EOF) { flog_err_confd("confd_fd_ready"); @@ -1187,6 +1181,26 @@ static int frr_confd_dp_read(struct thread *thread) return 0; } +static int frr_confd_dp_ctl_read(struct thread *thread) +{ + struct confd_daemon_ctx *dctx = THREAD_ARG(thread); + int fd = THREAD_FD(thread); + + thread_add_read(master, frr_confd_dp_ctl_read, dctx, fd, &t_dp_ctl); + + frr_confd_dp_read(dctx, fd); +} + +static int frr_confd_dp_worker_read(struct thread *thread) +{ + struct confd_daemon_ctx *dctx = THREAD_ARG(thread); + int fd = THREAD_FD(thread); + + thread_add_read(master, frr_confd_dp_worker_read, dctx, fd, &t_dp_worker); + + frr_confd_dp_read(dctx, fd); +} + static int frr_confd_subscribe_state(const struct lysc_node *snode, void *arg) { struct nb_node *nb_node = snode->priv; @@ -1314,9 +1328,9 @@ static int frr_confd_init_dp(const char *program_name) goto error; } - thread_add_read(master, frr_confd_dp_read, dctx, dp_ctl_sock, + thread_add_read(master, frr_confd_dp_ctl_read, dctx, dp_ctl_sock, &t_dp_ctl); - thread_add_read(master, frr_confd_dp_read, dctx, dp_worker_sock, + thread_add_read(master, frr_confd_dp_worker_read, dctx, dp_worker_sock, &t_dp_worker); return 0; |
