Author: emax Date: Thu Aug 2 20:48:22 2012 New Revision: 238994 URL: http://svn.freebsd.org/changeset/base/238994
Log: MFC r238599 Return zero from get_addrselectpolicy() when no source-address-selection policy is installed. Approved by: re (kib) Modified: stable/9/lib/libc/net/getaddrinfo.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Thu Aug 2 20:14:45 2012 (r238993) +++ stable/9/lib/libc/net/getaddrinfo.c Thu Aug 2 20:48:22 2012 (r238994) @@ -693,6 +693,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"