From: Antonio Huete Jimenez Date: Wed, 1 Aug 2012 19:25:29 +0000 (+0200) Subject: dhclient - Silence dhclient by immediately exiting if the interface doesn't exist. X-Git-Tag: v3.2.0~344 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9930e9a82403a68e5891a678e5e4d73b6027a30b dhclient - Silence dhclient by immediately exiting if the interface doesn't exist. Taken-from: OpenBSD --- diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 5350265..e342036 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: src/sbin/dhclient/dispatch.c,v 1.44 2009/06/06 04:02:42 krw Exp $ */ +/* $OpenBSD: src/sbin/dhclient/dispatch.c,v 1.45 2009/11/26 23:14:29 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -210,11 +210,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; } @@ -297,8 +294,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 bbbcaf2..100727b 100644 --- a/sbin/dhclient/errwarn.c +++ b/sbin/dhclient/errwarn.c @@ -1,5 +1,4 @@ -/* $OpenBSD: errwarn.c,v 1.15 2007/03/02 11:31:17 henning Exp $ */ -/* $DragonFly: src/sbin/dhclient/errwarn.c,v 1.1 2008/08/30 16:07:58 hasso Exp $ */ +/* $OpenBSD: src/sbin/dhclient/errwarn.c,v 1.17 2009/11/26 23:14:29 krw Exp $ */ /* Errors and warnings... */ @@ -80,9 +79,7 @@ error(char *fmt, ...) write(STDERR_FILENO, "\n", 1); } - syslog(LOG_CRIT, "exiting."); if (log_perror) { - fprintf(stderr, "exiting.\n"); fflush(stderr); } exit(1);