summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-03-02 13:00:03 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-03-02 13:00:03 +0000
commit9d47939f01a61e8a08f74a7e91ebbfe7bcf0af70 (patch)
tree5e5582952713e3deeb6b48fccc726ee07d2da59e /sbin/dhclient
parent0728e70a8383b60c535244d2166c442134efebce (diff)
if our interface vanishes (pcmcia and such), exit.
fixes PR3648, test & ok pb
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index aadd18ba9b1..4feccc97332 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.23 2004/03/02 12:56:30 henning Exp $ */
+/* $OpenBSD: dhclient.c,v 1.24 2004/03/02 13:00:02 henning Exp $ */
/* DHCP Client. */
@@ -163,6 +163,7 @@ routehandler(struct protocol *p)
struct rt_msghdr *rtm;
struct if_msghdr *ifm;
struct ifa_msghdr *ifam;
+ struct if_announcemsghdr *ifan;
struct interface_info *ip;
ssize_t n;
@@ -196,6 +197,12 @@ routehandler(struct protocol *p)
if ((rtm->rtm_flags & RTF_UP) == 0)
goto die;
break;
+ case RTM_IFANNOUNCE:
+ ifan = (struct if_announcemsghdr *)rtm;
+ if (ifan->ifan_what == IFAN_DEPARTURE &&
+ (ip = isours(ifan->ifan_index)) != NULL)
+ goto die;
+ break;
default:
break;
}