diff options
author | emax <emax@FreeBSD.org> | 2012-07-18 15:52:09 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2012-07-18 15:52:09 +0000 |
commit | c9ba4f7b25ec65c1aba9ca25cfd5978e43d00fba (patch) | |
tree | a7cbada49a6862fad00003eaf0bff7f3c6291842 /lib/libc/net | |
parent | e69c4af4ad8ad6392232cc111d173f2fc90675db (diff) | |
download | FreeBSD-src-c9ba4f7b25ec65c1aba9ca25cfd5978e43d00fba.zip FreeBSD-src-c9ba4f7b25ec65c1aba9ca25cfd5978e43d00fba.tar.gz |
Return zero from get_addrselectpolicy() when no source-address-selection
policy is installed.
MFC after: 1 week
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index d6feb71..d11ff78 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -692,6 +692,8 @@ get_addrselectpolicy(struct policyhead *head) 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) { |