Bug 709156

Summary: nc doesn't timeout on connect when -w is used
Product: [Fedora] Fedora Reporter: Michael Best <mbest>
Component: ncAssignee: Petr Šabata <psabata>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: james.juran, psabata, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nc-1.103-1.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-08 12:32:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michael Best 2011-05-30 21:16:26 UTC
Description of problem:
nc doesn't appear to time out properly with the -w option

Version-Release number of selected component (if applicable):
nc-1.100-2.fc15.x86_64

How reproducible:


Steps to Reproduce:
1. nc -w 1 <hostname> <port>
  
Actual results:
$ nc -w 1 www.google.com 1800
<times out after a few minutes>

Expected results:
$ nc -w 1 www.google.com 1800
<times out after 1 second>

Additional info:
May be related to #199503 #182736 #132973

Comment 1 Petr Šabata 2011-12-08 12:32:01 UTC
I dropped our custom patch for this feature with 1.100 update since it wasn't in line with upstream (see your nc(1) manpage for explanation).

However, upstream introduced support for connect timeout in 1.103.  This version is available in rawhide and will be part of Fedora 17.

I don't intend to change netcat's behaviour in stable releases.