Diff between a0fd2e4494f5c35152fe523d271ac7304ecb4591 and 779c9cc8969c8fbb69e0284a48541a2372eea415

Changed Files

File Additions Deletions Status
tools/l2test.c +1 -1 modified

Full Patch

diff --git a/tools/l2test.c b/tools/l2test.c
index abe09c1..1d458c4 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -644,7 +644,6 @@ static void do_listen(void (*handler)(int sk))
 			continue;
 		}
 		/* Child */
-		close(sk);
 
 		/* Set receive buffer size */
 		if (rcvbuf && setsockopt(nsk, SOL_SOCKET, SO_RCVBUF, &rcvbuf,
@@ -769,6 +768,7 @@ static void do_listen(void (*handler)(int sk))
 		}
 
 		handler(nsk);
+		close(sk);
 
 		syslog(LOG_INFO, "Disconnect: %m");
 		exit(0);