]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: improve error handling when connection to confd is lost
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 16 Nov 2018 23:02:36 +0000 (21:02 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 26 Nov 2018 17:51:57 +0000 (15:51 -0200)
This fixes an infinite loop that happened every time the connection
to the confd daemon was lost. Deactivate the confd module when
that happens to fix the infinite loop. This is only a temporary
workaround, in the long term we need to add a connection retry timer
to reestablish the connection to the confd daemon once it's back.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/northbound_confd.c

index 8cfa2fe113821fdee3d1bbbcf7e2e117a09407b0..ec5e0c32c3ba3f4a6b0880538bda8b426ec0ee33 100644 (file)
@@ -951,9 +951,11 @@ static int frr_confd_dp_read(struct thread *thread)
        ret = confd_fd_ready(dctx, fd);
        if (ret == CONFD_EOF) {
                flog_err_confd("confd_fd_ready");
+               frr_confd_finish();
                return -1;
        } else if (ret == CONFD_ERR && confd_errno != CONFD_ERR_EXTERNAL) {
                flog_err_confd("confd_fd_ready");
+               frr_confd_finish();
                return -1;
        }