diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2021-08-25 21:07:48 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2021-08-25 21:07:48 +0000 |
commit | ec1cbeefe4c4d0ef5fadaf431006914dadfb4ec9 (patch) | |
tree | 66b007b38c1b201d2a1592fafe5b033d941f9714 | |
parent | a265b415535361bef1d4d12da922b85d73a46d77 (diff) |
Don't use log_procname before it is initialized. In particular
set_iff_up() is called from initialize_interface() and was using
log_procname instead of ifi->name in its fatal()'s.
Diagnosed by tb@ from a recent reddit post by zielonykid1234.
-rw-r--r-- | sbin/dhclient/dhclient.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index e53538eb9dc..361de51b384 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.724 2021/07/27 18:35:30 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.725 2021/08/25 21:07:47 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -391,13 +391,13 @@ set_iff_up(struct interface_info *ifi, int ioctlfd) strlcpy(ifr.ifr_name, ifi->name, sizeof(ifr.ifr_name)); if (ioctl(ioctlfd, SIOCGIFFLAGS, (caddr_t)&ifr) == -1) - fatal("%s: SIOCGIFFLAGS", log_procname); + fatal("%s: SIOCGIFFLAGS", ifi->name); if ((ifr.ifr_flags & IFF_UP) == 0) { ifi->link_state = LINK_STATE_DOWN; ifr.ifr_flags |= IFF_UP; if (ioctl(ioctlfd, SIOCSIFFLAGS, (caddr_t)&ifr) == -1) - fatal("%s: SIOCSIFFLAGS", log_procname); + fatal("%s: SIOCSIFFLAGS", ifi->name); } } |