Date: Wed, 18 Jul 2012 15:52:09 +0000 (UTC) From: Maksim Yevmenkin <emax@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238599 - head/lib/libc/net Message-ID: <201207181552.q6IFq9TP086113@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emax Date: Wed Jul 18 15:52:09 2012 New Revision: 238599 URL: http://svn.freebsd.org/changeset/base/238599 Log: Return zero from get_addrselectpolicy() when no source-address-selection policy is installed. MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Wed Jul 18 15:43:47 2012 (r238598) +++ head/lib/libc/net/getaddrinfo.c Wed Jul 18 15:52:09 2012 (r238599) @@ -692,6 +692,8 @@ get_addrselectpolicy(struct policyhead * if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) return (0); + if (l == 0) + return (0); if ((buf = malloc(l)) == NULL) return (0); if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207181552.q6IFq9TP086113>