Bug 392431 - Incorrect error description for non-existent interfaces in connect(2)
Summary: Incorrect error description for non-existent interfaces in connect(2)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: man-pages
Version: 4.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Ivana Varekova
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 409961 858278
TreeView+ depends on / blocked
 
Reported: 2007-11-20 14:33 UTC by Adam Stokes
Modified: 2018-10-20 00:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 858278 (view as bug list)
Environment:
Last Closed: 2009-01-14 13:21:49 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0023 0 normal SHIPPED_LIVE man-pages bug fix update 2009-01-14 13:21:30 UTC

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

Version-Release number of selected component (if applicable):
man-pages-1.67-14

How reproducible:
Always

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 14:33:33 UTC
Created attachment 264931 [details]
Patch to correct man page

Comment 9 Adam Stokes 2008-11-18 14:22:05 UTC
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 14:22:26 UTC
Created attachment 323899 [details]
test case

Comment 14 errata-xmlrpc 2009-01-14 13:21:49 UTC
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.

http://rhn.redhat.com/errata/RHBA-2009-0023.html

Comment 16 Michael Kerrisk 2013-02-12 19:41:23 UTC
Adam,

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?

Thanks,

Michael

--- 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
 field.
 .TP
-.B EAGAIN
-No more free local ports or insufficient entries in the routing cache.
-For
-.B AF_INET
-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.
+.B EADDRNOTAVAIL
+Non-existent interface was requested or the requested address was not local.
 .TP
 .B EALREADY
 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.