Date: Thu, 4 Jul 2013 12:27:10 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252697 - head/sbin/dhclient Message-ID: <201307041227.r64CRBmQ090978@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307041227.r64CRBmQ090978>