From 034e2bb1db9aa14d15490688245636eb2cf4fbad Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Thu, 17 Apr 2014 11:04:00 -0400 Subject: [PATCH] When sockd transfers a file descriptor to ndhc, close the fd in sockd. Since the transfer is conceptually a move, this is the correct thing to do and prevents sockets from spuriously hanging around forever and eventually exhausting the per process limit on fds. --- src/sockd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sockd.c b/src/sockd.c index 96039c7..bbaac34 100644 --- a/src/sockd.c +++ b/src/sockd.c @@ -439,6 +439,7 @@ static void xfer_fd(int fd, char cmd) suicide("%s: (%s) sendmsg failed: %s", client_config.interface, __func__, strerror(errno)); } + close(fd); } static size_t execute_sockd(char *buf, size_t buflen)