]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make getnameinfo(3) salen requirement less strict and
authorHiroki Sato <hrs@FreeBSD.org>
Thu, 15 Mar 2018 13:46:28 +0000 (13:46 +0000)
committerHiroki Sato <hrs@FreeBSD.org>
Thu, 15 Mar 2018 13:46:28 +0000 (13:46 +0000)
commit20d96999a4c7fe7e2cdf5056b8a293e266564f4a
tree4c13bad11f7c5f9593a5939cddbb9d8bccc52a04
parenta7478ad1ce55256b1abbf327bb97ad60662e7332
Make getnameinfo(3) salen requirement less strict and
document details of salen in getnameinfo(3) manual page.

getnameinfo(3) returned EAI_FAIL when salen was not equal to
the length corresponding to the value specified by sa->sa_family.
However, POSIX or RFC 3493 does not require it and RFC 4038
Sec.6.2.3 shows an example passing sizeof(struct sockaddr_storage)
to salen.

This change makes the requirement less strict by accepting
salen up to sizeof(struct sockaddr_storage).  It also includes
two more changes: one is to fix return values because both SUSv4
and RFC 3493 require EAI_FAMILY when the address length is invalid,
another is to fix sa_len dependency in PF_LOCAL.

Pointed out by: Christophe Beauval
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D14585
lib/libc/net/getnameinfo.3
lib/libc/net/getnameinfo.c