Bug 1014681 - ncat with UDP seems working differently on ppc64 and s390x
ncat with UDP seems working differently on ppc64 and s390x
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nmap (Show other bugs)
7.0
ppc64 Unspecified
medium Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-02 10:21 EDT by Patrik Kis
Modified: 2013-10-18 05:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-18 05:35:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Patrik Kis 2013-10-02 10:21:49 EDT
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:
Comment 1 Michal Hlavinka 2013-10-17 10:58:38 EDT
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.
Comment 2 Patrik Kis 2013-10-18 05:22:53 EDT
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.

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