From 8f4d54c3fe9a0d797330892ee3dc3e2543c472a7 Mon Sep 17 00:00:00 2001 From: krw Date: Fri, 23 Jun 2017 19:51:07 +0000 Subject: [PATCH] Once you have forked into two processes, setting a global flag in one process does not mean the other process can see the change. Nuke the pointless IFI_NEW_LLADDR. --- sbin/dhclient/dhclient.c | 6 ++---- sbin/dhclient/dhcpd.h | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 57ef5f3c485..cb05d88474c 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -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 @@ -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); diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index a3d279fe751..530d0250570 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -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 @@ -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 -- 2.20.1