Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/dhcp/dist/client Wait for all the interfaces sp...



details:   https://anonhg.NetBSD.org/src/rev/2de4b76cc216
branches:  trunk
changeset: 326582:2de4b76cc216
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Feb 04 22:34:39 2014 +0000

description:
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?

diffstat:

 external/bsd/dhcp/dist/client/dhclient.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (57 lines):

diff -r 82d2a4137a4c -r 2de4b76cc216 external/bsd/dhcp/dist/client/dhclient.c
--- a/external/bsd/dhcp/dist/client/dhclient.c  Tue Feb 04 22:21:35 2014 +0000
+++ b/external/bsd/dhcp/dist/client/dhclient.c  Tue Feb 04 22:34:39 2014 +0000
@@ -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 @@
 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 @@
         */
        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 @@
  */
 
 #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 @@
        if (no_daemon)
                return;
 
+       if (interfaces_left && --interfaces_left)
+               return;
+
        /* Only do it once. */
        if (state)
                return;



Home | Main Index | Thread Index | Old Index