Created attachment 954799 [details] Patch to close accepted socket when done Description of problem: Start the server side with: nc6 -l -p xxx -e some_script --continuous Every time a client connects to it and then quits, a socket in CLOSE_WAIT state will appear in the server system and the socket will stay in that state for a long time(if not forever) judging from the netstat output. Version-Release number of selected component (if applicable): nc6-1.0-17.fc20 How reproducible: Always Steps to Reproduce: 1. start nc6 as a listening socket as shown above 2. a client connects to it, and then quits 3. Actual results: A socket in CLOSE_WAIT state appeared in the server system and stay in that state like forever(unless the nc6 program on the server system quits) Expected results: A socket in TIME_WAIT state appeared in the server system and then disappear from the netstat output Additional info: From the netcat6 homepage, it seems the original authors do not care about this package anymore. But since we are still providing this package in Fedora, better to fix this problem. The benefit of nc6 over nmap-ncat is that it is small and do not depend on a lot of shared libraries. The fix seems to be easy: just add a close(ns) in afindep_listener, I've attached a patch for this. Someone please kindly review it, as I do not have much network programming experience.
Thank you. This looks good.
nc6-1.0-21.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/nc6-1.0-21.fc20
nc6-1.0-21.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/nc6-1.0-21.fc19
nc6-1.0-21.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/nc6-1.0-21.fc21
nc6-1.0-21.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
nc6-1.0-21.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
nc6-1.0-21.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.