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

Reply via email to