Hide Forgot
Description of problem: This is maybe not the normal use case but it works as expected on x86_64 it just differs in ppc64 and s390x. See the reproducer below. Version-Release number of selected component (if applicable): nmap-ncat-6.40-2.el7 How reproducible: always Steps to Reproduce: Have two terminals opened on the same machine (one client and one server): SERVER: # echo ServerSend |ncat -vl --udp 6666 Ncat: Version 6.40 ( http://nmap.org/ncat ) Ncat: Listening on :::6666 Ncat: Listening on 0.0.0.0:6666 Ncat: Connection refused. CLIENT: # echo ClientSend |ncat -4 --udp localhost 6666 # Actual results: The connection fails. Expected results: As on x86_64: SERVER: # echo ServerSend |ncat -vl --udp 6666 Ncat: Version 6.40 ( http://nmap.org/ncat ) Ncat: Listening on :::6666 Ncat: Listening on 0.0.0.0:6666 ClientSend CLIENT: # echo ClientSend |ncat -4 --udp localhost 6666 ServerSend Additional info:
Did you really get your expected results on x86_64? Because that (not this) would be bug. ncat uses EOF as control mechanism, it will terminate ncat immediately and won't wait for remaining data neither it will process them. It's different behaviour from old nc. What happens in your test: server: ncat listens for incomming udp packet together with "ServerSend\n<EOF>" waiting on its input when you run client, it gets "ClientSend\n<EOF>" so it sends packet to server and terminates immediately. There is no time window for server's packet to reach client. Meanwhile server gets new UDP connection, so it checks input, finds "ServerSend\n" and sends it. Because client already exited, server prints connection refused. Because server finds also EOF, it won't process any (remaining) data from client and exits.
I see, it quite makes sense. BTW, I tested again the whole "issue" and it seems that the behavior I expected appears only on virtual machines. On real x86_64 the behavior is the same as on pcc64 and s390x. So the bug can be closed. Thanks for explanation. I will rewrite my test.