summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-11-26 23:14:30 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-11-26 23:14:30 +0000
commit8b11e1432e0e80298847a164b1d8792a92603605 (patch)
treeb43eee2a58b1e3fb4f578befb6838d7e3bc6278b /sbin/dhclient
parent6f5b7aaddc859f35419e4f834a67f2d6f372f9da (diff)
Silence dhclient by immediately exiting if the interface doesn't exist
or can't return important flags via ioctl. Excess verbiage pointed out by deraadt@. ok henning@
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dispatch.c10
-rw-r--r--sbin/dhclient/errwarn.c4
2 files changed, 4 insertions, 10 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index f01d914e151..0a798596de4 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.44 2009/06/06 04:02:42 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.45 2009/11/26 23:14:29 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -209,11 +209,8 @@ got_one(void)
if ((!interface_status(ifi->name)) ||
(ifi->noifmedia && ifi->errors > 20)) {
/* our interface has gone away. */
- warning("Interface %s no longer appears valid.",
+ error("Interface %s no longer appears valid.",
ifi->name);
- interfaces_invalidated = 1;
- close(ifi->rfdesc);
- ifi->rfdesc = -1;
}
return;
}
@@ -296,8 +293,7 @@ interface_status(char *ifname)
memset(&ifr, 0, sizeof(ifr));
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) {
- warning("ioctl(SIOCGIFFLAGS) on %s: %m", ifname);
- goto inactive;
+ error("ioctl(SIOCGIFFLAGS) on %s: %m", ifname);
}
/*
diff --git a/sbin/dhclient/errwarn.c b/sbin/dhclient/errwarn.c
index ac777f1194b..2357936be92 100644
--- a/sbin/dhclient/errwarn.c
+++ b/sbin/dhclient/errwarn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: errwarn.c,v 1.16 2009/06/06 04:02:42 krw Exp $ */
+/* $OpenBSD: errwarn.c,v 1.17 2009/11/26 23:14:29 krw Exp $ */
/* Errors and warnings... */
@@ -78,9 +78,7 @@ error(char *fmt, ...)
write(STDERR_FILENO, "\n", 1);
}
- syslog(LOG_CRIT, "exiting.");
if (log_perror) {
- fprintf(stderr, "exiting.\n");
fflush(stderr);
}
exit(1);