OpenSolaris

Printable Version Enter a New Search
Bug ID 6818540
Synopsis udptest() in netcat needs more work
State 3-Accepted (Yes, that is a problem)
Category:Subcategory network:internet-utility
Keywords oss-bite-size
Sponsor
Submitter
Responsible Engineer Vladimir Kotal
Reported Against
Duplicate Of
Introduced In
Commit to Fix
Fixed In
Release Fixed
Related Bugs
Submit Date 17-March-2009
Last Update Date 17-March-2009
Description
udptest() in usr/src/cmd/cmd-inet/usr.bin/nc/netcat.c is accompanied with curious comment (which comes from the original code):

    854 /*
    855  * udptest()
    856  * Do a few writes to see if the UDP port is there.
    857  * XXX - Better way of doing this? Doesn't work for IPv6.
    858  * Also fails after around 100 ports checked.
    859  */

It's indeed not very reliable as the nc(1) man page suggests:

NOTES
     UDP port scans always succeeds, that is, reports the port as
     open, rendering the -uz combination of flags relatively use-
     less.

It'd be probably too much to incorporate UDP port scanning techniques [*] but
the statements about IPv6 and 100 ports should be verified and fixed (one way or the other - in code or the comment itself).

[*] That said, the XXXX pattern in udptest() could be made configurable.
Work Around
N/A
Comments
N/A