diff options
author | pjd <pjd@FreeBSD.org> | 2013-07-04 12:27:10 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2013-07-04 12:27:10 +0000 |
commit | e71a9f5bfa78184fcc3776a5603940f09cf23e66 (patch) | |
tree | ec6cbb0c6190a43f09b98104aad26f0dcf280e6e | |
parent | e4c08953685a4e28f0f17d12de2476c1a1f555a3 (diff) | |
download | FreeBSD-src-e71a9f5bfa78184fcc3776a5603940f09cf23e66.zip FreeBSD-src-e71a9f5bfa78184fcc3776a5603940f09cf23e66.tar.gz |
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
-rw-r--r-- | sbin/dhclient/dhclient.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index cd4a41b..c8f05b5 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -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) |