From owner-svn-src-head@FreeBSD.ORG Wed Jul 18 15:52:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AFF71065677; Wed, 18 Jul 2012 15:52:10 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B6F8FC16; Wed, 18 Jul 2012 15:52:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IFq9GC086115; Wed, 18 Jul 2012 15:52:09 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IFq9TP086113; Wed, 18 Jul 2012 15:52:09 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201207181552.q6IFq9TP086113@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 18 Jul 2012 15:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238599 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 15:52:10 -0000 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) {