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.
Please test this bug against a newer version of man-pages to see if it's fixed. Thanks Nick
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.
EHOSTUNREACH is described in the manpage at least since 2020-04-11 (https://man7.org/linux/man-pages/man2/connect.2.html)