]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/imsg.c
Merge pull request #3356 from opensourcerouting/router-id-loopbacks
[mirror_frr.git] / lib / imsg.c
index 54241407205d203f0ae3964e784afbf27bc03e7d..935d13772752a2a668fc4d9699793c4addd7845a 100644 (file)
@@ -299,11 +299,10 @@ int imsg_get_fd(struct imsgbuf *ibuf)
        int fd;
        struct imsg_fd *ifd;
 
-       if ((ifd = TAILQ_FIRST(&ibuf->fds)) == NULL)
+       if ((ifd = TAILQ_POP_FIRST(&ibuf->fds, entry)) == NULL)
                return (-1);
 
        fd = ifd->fd;
-       TAILQ_REMOVE(&ibuf->fds, ifd, entry);
        free(ifd);
 
        return (fd);