From owner-svn-src-head@FreeBSD.ORG Thu Jul 4 12:27:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C42EC0D; Thu, 4 Jul 2013 12:27:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA6411F5; Thu, 4 Jul 2013 12:27:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64CRBIi090979; Thu, 4 Jul 2013 12:27:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64CRBmQ090978; Thu, 4 Jul 2013 12:27:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307041227.r64CRBmQ090978@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 4 Jul 2013 12:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252697 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 04 Jul 2013 12:27:11 -0000 Author: pjd Date: Thu Jul 4 12:27:10 2013 New Revision: 252697 URL: http://svnweb.freebsd.org/changeset/base/252697 Log: Fix dhclient for interfaces that are down. The discover_interfaces() function that looks for interface skips interfaces that are not UP. We need to call dhclient-script PREINIT before we call discover_interfaces(), so the script has a chance to bring the interface UP. Reported by: alfred Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Thu Jul 4 12:24:39 2013 (r252696) +++ head/sbin/dhclient/dhclient.c Thu Jul 4 12:27:10 2013 (r252697) @@ -457,6 +457,11 @@ main(int argc, char *argv[]) if (gethostname(hostname, sizeof(hostname)) < 0) hostname[0] = '\0'; + priv_script_init("PREINIT", NULL); + if (ifi->client->alias) + priv_script_write_params("alias_", ifi->client->alias); + priv_script_go(); + /* set up the interface */ discover_interfaces(ifi); @@ -483,11 +488,6 @@ main(int argc, char *argv[]) rewrite_client_leases(); close(fd); - priv_script_init("PREINIT", NULL); - if (ifi->client->alias) - priv_script_write_params("alias_", ifi->client->alias); - priv_script_go(); - if ((routefd = socket(PF_ROUTE, SOCK_RAW, 0)) != -1) add_protocol("AF_ROUTE", routefd, routehandler, ifi); if (shutdown(routefd, SHUT_WR) < 0)