diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-11-26 23:14:30 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-11-26 23:14:30 +0000 |
commit | 8b11e1432e0e80298847a164b1d8792a92603605 (patch) | |
tree | b43eee2a58b1e3fb4f578befb6838d7e3bc6278b /sbin/dhclient/dispatch.c | |
parent | 6f5b7aaddc859f35419e4f834a67f2d6f372f9da (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/dispatch.c')
-rw-r--r-- | sbin/dhclient/dispatch.c | 10 |
1 files changed, 3 insertions, 7 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); } /* |