Hide Forgot
Created attachment 511528 [details] Source code patch Description of problem: When using -C option with nc, the program makes two writes into socket: 1) the message itself 2) the CRLF bytes "\r\n" For TCP it results in aditional message of 2 bytes + ack, but since TCP is a stream, the client or server may not notice. For UDP it results in two separate datagrams and this is bad as UDP does not guarantee delivery nor order of the datagrams. Even the client/server is got by surprise as it expected a single datagram containing a valid protocol message. Version-Release number of selected component (if applicable): nc-1.100-2.fc15.i686 How reproducible: (TCP) nc -C 127.0.0.1 <port> (UDP) nc -C -u 127.0.0.1 <port> Steps to Reproduce: see above Actual results: see Wireshark dumps attached (nc_tcp_orig.cap, nc_udp_orig.cap) Expected results: using the supplied patch, CRLF is sent in the same message (one write to the socket), see Wireshark dumps attached (nc_tcp_fixed.cap, nc_udp_fixed.cap) Additional info: Patch against nc-1.100-2.fc15 provided for review.
Created attachment 511531 [details] Wireshark capture of original TCP behavior
Created attachment 511532 [details] Wireshark capture of original UDP behavior
Created attachment 511533 [details] Wireshark capture of fixed TCP behavior
Created attachment 511534 [details] Wireshark capture of fixed UDP behavior
Thanks, Jaroslav. The patch looks good to me.
nc-1.100-3.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/nc-1.100-3.fc15
Package nc-1.100-3.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing nc-1.100-3.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/nc-1.100-3.fc15 then log in and leave karma (feedback).
nc-1.100-3.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.