| Previous | Next |
| ENOPROTOOPT | ENOSR |
EAFNOSUPPORT
The address representation does not fit the requested communications domain
EAFNOSUPPORT is raised for an unsupported or incompatible address family. Solaris describes using an address that is incompatible with the requested protocol. POSIX socket() also uses this errno when the implementation does not support the specified address family.
That differs from EPFNOSUPPORT, a Solaris protocol-family error, and from EPROTONOSUPPORT, which concerns the protocol implementation. A common diagnostic mistake is to inspect only the destination text while ignoring the sa_family/domain values carried with the address.
Check address family at both creation and use
- Log the socket domain and the address structure family supplied to
bind()orconnect(). - Verify the structure type and length match the selected family; a cast can hide an IPv4/IPv6 family mismatch.
- In dual-stack code, trace address resolution and family filtering so an address from one family is not passed to a socket created for another.
References
- Oracle Solaris intro(2) errno catalog
- POSIX socket() domain, type, and protocol rules
- POSIX bind() local-address rules
Looking for a different code? Search another status or error code.
