Bug 392431 - Incorrect error description for non-existent interfaces in connect(2)
Incorrect error description for non-existent interfaces in connect(2)
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: man-pages (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Ivana Varekova
Depends On:
Blocks: 409961 858278
  Show dependency treegraph
Reported: 2007-11-20 09:33 EST by Adam Stokes
Modified: 2013-02-12 14:41 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 858278 (view as bug list)
Last Closed: 2009-01-14 08:21:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to correct man page (663 bytes, patch)
2007-11-20 09:33 EST, Adam Stokes
no flags Details | Diff
test case (974 bytes, text/x-csrc)
2008-11-18 09:22 EST, Adam Stokes
no flags Details

  None (edit)
Description Adam Stokes 2007-11-20 09:33:33 EST
Description of problem:
The man page of connect(2) says that,
     No more free local ports or insufficient entries in the routing cache."
 However, the present system returns "EADDRNOTAVAIL" at the above-mentioned

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. man 2 connect
Actual results:
Describes EAGAIN

Expected results:
Should describe EADDRNOTAVAIL

Additional info:
Comment 1 Adam Stokes 2007-11-20 09:33:33 EST
Created attachment 264931 [details]
Patch to correct man page
Comment 9 Adam Stokes 2008-11-18 09:22:05 EST
test case:

1. compile the sample test program.
  (please refer attached file: 'sample_test.c')

  $ gcc -o sample_test tample_test.c

2. change the local port range.

  $ cat /proc/sys/net/ipv4/ip_local_port_range
  $ echo "60999 61000" > /proc/sys/net/ipv4/ip_local_port_range

3. run test program

  $ ./sample_test
  connect: OK: 0
  connect: OK: 1
  connect: ERROR: errno=99

'errno=99' means EADDRNOTAVAIL.
Comment 10 Adam Stokes 2008-11-18 09:22:26 EST
Created attachment 323899 [details]
test case
Comment 14 errata-xmlrpc 2009-01-14 08:21:49 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Comment 16 Michael Kerrisk 2013-02-12 14:41:23 EST

Upstream here, long after the fact. The current RH patch is below. I am wondering whether to take it upstream. I follow what you've shown in comment 9, but I don't understand the other changes you've made in the patch:
* Why drop mention of ip_local_port_range?
* How did you arrive at the new text?



--- man-pages-3.42.orig/man2/connect.2	2012-08-14 00:39:35.000000000 +0200
+++ man-pages-3.42/man2/connect.2	2012-09-18 16:21:40.502613484 +0200
@@ -152,14 +152,8 @@
 .I sa_family
-No more free local ports or insufficient entries in the routing cache.
-see the description of
-.I /proc/sys/net/ipv4/ip_local_port_range
-.BR ip (7)
-for information on how to increase the number of local ports.
+Non-existent interface was requested or the requested address was not local.
 The socket is nonblocking and a previous connection attempt has not yet

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