]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- fast-reload, detect loop in sock_poll_timeout routine.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 6 Nov 2023 15:04:46 +0000 (16:04 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 6 Nov 2023 15:04:46 +0000 (16:04 +0100)
daemon/remote.c

index 22128d2a5540337f37bfdd6968b58c84bbc4c63e..5f9d9064f7b4d7e84a249dd8e1c073780e83e55f 100644 (file)
@@ -3394,10 +3394,17 @@ int remote_control_callback(struct comm_point* c, void* arg, int err,
 static int
 sock_poll_timeout(int fd, int timeout, int pollin, int pollout, int* event)
 {
+       int loopcount = 0;
        /* Loop if the system call returns an errno to do so, like EINTR. */
        while(1) {
                struct pollfd p, *fds;
                int nfds, ret;
+               if(++loopcount > 200) {
+                       log_err("sock_poll_timeout: loop");
+                       if(event)
+                               *event = 0;
+                       return 0;
+               }
                if(fd == -1) {
                        fds = NULL;
                        nfds = 0;