Module Name: src Committed By: christos Date: Tue Feb 4 22:34:39 UTC 2014
Modified Files: src/external/bsd/dhcp/dist/client: dhclient.c Log Message: Wait for all the interfaces specified on the command line to be configured before daemonizing, not just the first one. Perhaps we should introduce a separate flag for this behavior? To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/dhcp/dist/client/dhclient.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/dhcp/dist/client/dhclient.c diff -u src/external/bsd/dhcp/dist/client/dhclient.c:1.7 src/external/bsd/dhcp/dist/client/dhclient.c:1.8 --- src/external/bsd/dhcp/dist/client/dhclient.c:1.7 Thu Jun 20 11:14:03 2013 +++ src/external/bsd/dhcp/dist/client/dhclient.c Tue Feb 4 17:34:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: dhclient.c,v 1.7 2013/06/20 15:14:03 christos Exp $ */ +/* $NetBSD: dhclient.c,v 1.8 2014/02/04 22:34:39 christos Exp $ */ /* dhclient.c @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: dhclient.c,v 1.7 2013/06/20 15:14:03 christos Exp $"); +__RCSID("$NetBSD: dhclient.c,v 1.8 2014/02/04 22:34:39 christos Exp $"); #include "dhcpd.h" #include <syslog.h> @@ -60,6 +60,7 @@ isc_boolean_t hw_mismatch_drop = ISC_TRU int dhcp_max_agent_option_packet_length = 0; int interfaces_requested = 0; +int interfaces_left = 0; struct iaddr iaddr_broadcast = { 4, { 255, 255, 255, 255 } }; struct iaddr iaddr_any = { 4, { 0, 0, 0, 0 } }; @@ -367,8 +368,10 @@ main(int argc, char **argv) { */ go_daemon(); setup(); - if (interfaces_requested > 0) + if (interfaces_requested > 0) { add_interfaces(ifaces, interfaces_requested); + interfaces_left = interfaces_requested; + } free(ifaces); if (wanted_ia_na < 0) { wanted_ia_na = 1; @@ -894,7 +897,7 @@ int find_subnet (struct subnet **sp, */ #include <sys/cdefs.h> -__RCSID("$NetBSD: dhclient.c,v 1.7 2013/06/20 15:14:03 christos Exp $"); +__RCSID("$NetBSD: dhclient.c,v 1.8 2014/02/04 22:34:39 christos Exp $"); void state_reboot (cpp) void *cpp; @@ -3486,6 +3489,9 @@ void finish_daemon (void) if (no_daemon) return; + if (interfaces_left && --interfaces_left) + return; + /* Only do it once. */ if (state) return;