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?
This commit is contained in:
christos 2014-02-04 22:34:39 +00:00
parent f0aa8ebfcc
commit d39376afb9

View File

@ -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_TRUE;
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;