mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Since sa->sa_len doesn't match sizeof(struct sockaddr_dl),
getnameinfo() fails against sockaddr_dl. This commit is workaround for this problem.
This commit is contained in:
parent
3e687cd867
commit
6ad5f7ca01
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290372
|
@ -527,6 +527,10 @@ routename(struct sockaddr *sa, int flags)
|
|||
static char line[NI_MAXHOST];
|
||||
int error, f;
|
||||
|
||||
/* XXX: sa->sa_len doesn't match sizeof(struct sockaddr_dl) */
|
||||
if (sa->sa_family == AF_LINK)
|
||||
sa->sa_len = sizeof(struct sockaddr_dl);
|
||||
|
||||
f = (flags) ? NI_NUMERICHOST : 0;
|
||||
error = getnameinfo(sa, sa->sa_len, line, sizeof(line),
|
||||
NULL, 0, f);
|
||||
|
|
Loading…
Reference in a new issue