Red Hat Bugzilla – Bug 392431
Incorrect error description for non-existent interfaces in connect(2)
Last modified: 2018-10-19 20:30:06 EDT
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):
Steps to Reproduce:
1. man 2 connect
Should describe EADDRNOTAVAIL
Created attachment 264931 [details]
Patch to correct man page
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
connect: OK: 0
connect: OK: 1
connect: ERROR: errno=99
'errno=99' means EADDRNOTAVAIL.
Created attachment 323899 [details]
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.
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 @@
-No more free local ports or insufficient entries in the routing cache.
-see the description of
-.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