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
This commit is contained in:
parent
27f90bebef
commit
374a8a322b
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user