summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-02-17 17:04:42 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-02-17 17:04:42 +0000
commitf7e7109b180491daa989293551a22ffadaab6191 (patch)
tree8c43cbc10a3c9f74a61dbd01ac1d4bb960d8c41a /sbin/dhclient
parent1311dac9f9bc89fc26f8f05ddf7bf234cc05eb6c (diff)
Suppress some pointless debugging message:
1) If the pipe to the priv process is closed while waiting for something to happen in the non-priv dispatch() loop, assume the priv process issued an error message and exit without additional verbiage. 2) Ditto if the pipe to the priv process is closed when the flush of IMSG_CLEANUP is attempted. 3) No need to report when SIOCDIFADDR fails because the address is already gone. Start to ensure the priv process always issues a useful message before exiting by noting when it restarts due to the LLADDR having changed. Prodded by deraadt@ to clean this up.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c3
-rw-r--r--sbin/dhclient/dispatch.c4
-rw-r--r--sbin/dhclient/kroute.c9
3 files changed, 9 insertions, 7 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index c68b9bc6a2e..f3140402289 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.235 2013/02/17 00:02:44 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.236 2013/02/17 17:04:41 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -267,6 +267,7 @@ routehandler(void)
memcpy(&hw, &ifi->hw_address, sizeof(hw));
discover_interface();
if (memcmp(&hw, &ifi->hw_address, sizeof(hw))) {
+ warning("LLADDR changed; restarting");
quit = SIGHUP;
return;
}
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index 31241325130..65664feab5c 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.72 2013/02/14 22:18:12 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.73 2013/02/17 17:04:41 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -197,7 +197,7 @@ another:
}
}
if ((fds[2].revents & (POLLIN | POLLHUP))) {
- warning("lost connection to [priv]");
+ /* Pipe to [priv] closed. Assume it emitted error. */
quit = SIGQUIT;
continue;
}
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c
index 898bfd0d07d..8680b1e6928 100644
--- a/sbin/dhclient/kroute.c
+++ b/sbin/dhclient/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.33 2013/02/17 15:48:03 krw Exp $ */
+/* $OpenBSD: kroute.c,v 1.34 2013/02/17 17:04:41 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
@@ -424,8 +424,9 @@ priv_delete_address(struct imsg_delete_address *imsg)
/* SIOCDIFADDR will result in a RTM_DELADDR message we must catch! */
if (ioctl(s, SIOCDIFADDR, &ifaliasreq) == -1) {
- warning("SIOCDIFADDR failed (%s): %s", inet_ntoa(imsg->addr),
- strerror(errno));
+ if (errno != EADDRNOTAVAIL)
+ warning("SIOCDIFADDR failed (%s): %s",
+ inet_ntoa(imsg->addr), strerror(errno));
close(s);
return;
}
@@ -676,7 +677,7 @@ cleanup(struct client_lease *active)
/* Do flush so cleanup message gets through immediately. */
rslt = imsg_flush(unpriv_ibuf);
- if (rslt == -1)
+ if (rslt == -1 && errno != EPIPE)
warning("cleanup: imsg_flush: %s", strerror(errno));
}