From a7d055e4ff4d476814c8b2ee56691ed5e853b6bd Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 16 Nov 2018 21:02:36 -0200 Subject: [PATCH] lib: improve error handling when connection to confd is lost 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 --- lib/northbound_confd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/northbound_confd.c b/lib/northbound_confd.c index 8cfa2fe113..ec5e0c32c3 100644 --- a/lib/northbound_confd.c +++ b/lib/northbound_confd.c @@ -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; } -- 2.39.5