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) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"