Bug 39652 - connect (2) under IPv6 has an incomplete list of returnable error numbers
Summary: connect (2) under IPv6 has an incomplete list of returnable error numbers
Status: NEW
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 17:54 UTC by kernel@chappell-family.com
Modified: 2020-08-03 19:54 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.37
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description kernel@chappell-family.com 2011-07-20 17:54:59 UTC
I believe this applies to many 2.6.xx kernel documentation sets.

The man-page for connect (2) has an incomplete list of potential error reasons (indicated in errno) and their descriptive causes when attempting to connect to a remote IPv6 server and the return value indicates an error (-1).

Observed by testing with 2.6.37:

ENETUNREACH – reason should additionally include reference to the receipt of an ICMPv6 type 1 code 0 (no route to destination) response.

EACCES – reason should additionally include reference to the receipt of an ICMPv6 type 1 code 1 (Administratively prohibited) response.

EHOSTUNREACH – this isn't documented as a potential reason at present, but I believe it should be added and the causes are ICMPv6 type 1 code 3 (Address unreachable - I've verified this to be the case) or ICMPv6 type 3 (Time exceeded – I haven't verified this case - please check source code).

ECONNREFUSED – reason should additionally include reference to the receipt of an ICMPv6 type 1 code 4 (Port unreachable) or TCP RST/ACK response.

Having looked through v2.6.31 source it appears that potentially the following could also occur although I haven't verified this to be the case:

EMSGSIZE – ICMPv6 type 2 – ICMPv6 type 2 (Packet too big)
EPROTO – ICMPv6 type 4 – ICMPv6 type 4 (Parameter problem)

Thanks.
Comment 1 xerofoify 2014-06-25 16:02:13 UTC
Please test this bug against a newer version of man-pages to see if it's
fixed.
Thanks Nick
Comment 2 kernel@chappell-family.com 2014-06-25 20:03:16 UTC
Nick,

Thanks for the reply. I've just tested this with version 3.53 of the man pages and it now seems correct, apart from:

1. EHOSTUNREACH - this is still missing as a potential reason. I believe it should be added and the causes are ICMPv6 type 1 code 3 (Address unreachable - I've verified this to be the case) or ICMPv6 type 3 (Time exceeded – I haven't verified this case - please check source code).

2. There's also no mention of:

EMSGSIZE or EPROTO - did you check these? I haven't rechecked the source since I originally raised the issue.

Best wishes,

Tim.
Comment 3 Erik Rigtorp 2020-08-03 19:54:30 UTC
EHOSTUNREACH is described in the manpage at least since 2020-04-11 (https://man7.org/linux/man-pages/man2/connect.2.html)

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