Author: ume Date: Wed Nov 4 19:09:42 2015 New Revision: 290372 URL: https://svnweb.freebsd.org/changeset/base/290372
Log: Since sa->sa_len doesn't match sizeof(struct sockaddr_dl), getnameinfo() fails against sockaddr_dl. This commit is workaround for this problem. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Nov 4 19:05:04 2015 (r290371) +++ head/usr.bin/netstat/route.c Wed Nov 4 19:09:42 2015 (r290372) @@ -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); _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"