Once you have forked into two processes, setting a global flag
authorkrw <krw@openbsd.org>
Fri, 23 Jun 2017 19:51:07 +0000 (19:51 +0000)
committerkrw <krw@openbsd.org>
Fri, 23 Jun 2017 19:51:07 +0000 (19:51 +0000)
in one process does not mean the other process can see the
change. Nuke the pointless IFI_NEW_LLADDR.

sbin/dhclient/dhclient.c
sbin/dhclient/dhcpd.h

index 57ef5f3..cb05d88 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhclient.c,v 1.444 2017/06/23 16:09:38 krw Exp $      */
+/*     $OpenBSD: dhclient.c,v 1.445 2017/06/23 19:51:07 krw Exp $      */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -375,7 +375,6 @@ routehandler(struct interface_info *ifi)
                        get_hw_address(ifi);
                        if (memcmp(&hw, &ifi->hw_address, sizeof(hw))) {
                                log_warnx("LLADDR changed; restarting");
-                               ifi->flags |= IFI_NEW_LLADDR;
                                quit = SIGHUP;
                                goto done;
                        }
@@ -2111,8 +2110,7 @@ fork_privchld(struct interface_info *ifi, int fd, int fd2)
        }
 
        if (quit == SIGHUP) {
-               if (!(ifi->flags & IFI_HUP) &&
-                   (!(ifi->flags & IFI_NEW_LLADDR)))
+               if (!(ifi->flags & IFI_HUP))
                        log_warnx("%s; restarting.", strsignal(quit));
                signal(SIGHUP, SIG_IGN); /* will be restored after exec */
                execvp(saved_argv[0], saved_argv);
index a3d279f..530d025 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhcpd.h,v 1.192 2017/06/23 15:40:56 krw Exp $ */
+/*     $OpenBSD: dhcpd.h,v 1.193 2017/06/23 19:51:07 krw Exp $ */
 
 /*
  * Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -135,7 +135,6 @@ struct interface_info {
        int                      rdomain;
        int                      flags;
 #define        IFI_VALID_LLADDR        0x01
-#define IFI_NEW_LLADDR         0x02
 #define IFI_HUP                        0x04
 #define IFI_IS_RESPONSIBLE     0x08
 #define IFI_IN_CHARGE          0x10