The connect() system call should return -1 and set errno to EAFNOSUPPORT if it is called on a TCP socket
- with an IPv6 address and the socket is bound to an IPv4-mapped IPv6 address.
- with an IPv4-mapped IPv6 address and the socket is bound to an IPv6 address.
Without this patch, SYN-segments are sent out and eventually the connect() call times out.
Thanks to Jonathan T. Leighton for reporting this issue.