| Previous | Next |
| EL3RST | ECANCELED |
EAFNOSUPPORT
The address does not fit the socket's family
EAFNOSUPPORT means that the address presented to a socket operation is not valid for that socket's address family. It is often visible in bind(), connect(), sendto(), or sendmsg() when a sockaddr was built for the wrong family.
The family field and the address length must be treated as one object. A valid-looking port number or byte sequence is not enough: an IPv4 address, IPv6 address, and local-domain pathname have different structure and interpretation rules.
Checks that produce evidence
- Log the socket's family, the
sa_familyfield, supplied address length, and the API that consumed the address. - Verify that a dual-stack or proxy layer did not reuse an IPv4 address structure for an IPv6 socket, or pass a destination object after its storage was overwritten.
- For local-domain sockets, record the exact pathname or abstract-address representation separately from Internet-address logs.
Not the same as unreachable
The kernel rejected the address representation before it could decide whether a network or host was reachable. Compare this with ENETUNREACH and EHOSTUNREACH, which require a usable destination address.
References
Looking for a different code? Search another status or error code.