Date: Wed, 4 Nov 2015 19:09:42 +0000 (UTC) From: Hajimu UMEMOTO <ume@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290372 - head/usr.bin/netstat Message-ID: <201511041909.tA4J9gIX036547@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511041909.tA4J9gIX036547>