Bug 1161432 - nc6 server side keeps socket open after client quits
Summary: nc6 server side keeps socket open after client quits
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: nc6
Version: 20
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Petr Šabata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-07 06:30 UTC by Aaron Lu
Modified: 2015-02-23 16:01 UTC (History)
3 users (show)

Fixed In Version: nc6-1.0-21.fc19
Clone Of:
Environment:
Last Closed: 2015-02-23 16:01:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to close accepted socket when done (956 bytes, application/mbox)
2014-11-07 06:30 UTC, Aaron Lu
no flags Details

Description Aaron Lu 2014-11-07 06:30:42 UTC
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.

Comment 1 Petr Šabata 2014-11-07 12:57:40 UTC
Thank you.  This looks good.

Comment 2 Fedora Update System 2014-11-07 13:44:51 UTC
nc6-1.0-21.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/nc6-1.0-21.fc20

Comment 3 Fedora Update System 2014-11-07 13:45:06 UTC
nc6-1.0-21.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/nc6-1.0-21.fc19

Comment 4 Fedora Update System 2014-11-07 14:06:21 UTC
nc6-1.0-21.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/nc6-1.0-21.fc21

Comment 5 Fedora Update System 2014-11-19 15:58:38 UTC
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.

Comment 6 Fedora Update System 2014-11-19 16:00:32 UTC
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.

Comment 7 Fedora Update System 2014-12-06 10:12:20 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.