diff options
author | 2013-02-21 14:10:22 +0000 | |
---|---|---|
committer | 2013-02-21 14:10:22 +0000 | |
commit | ada079234f19ccac1fb7e8dad3ade776f52c1dc2 (patch) | |
tree | 19192dc67cb28f349b4d6986d6ba72f8a7170354 | |
parent | Nuke unused imsg_resolv_conf struct and declaration for non-existant function priv_resolv_conf(). (diff) | |
download | wireguard-openbsd-ada079234f19ccac1fb7e8dad3ade776f52c1dc2.tar.xz wireguard-openbsd-ada079234f19ccac1fb7e8dad3ade776f52c1dc2.zip |
Use imsg_flush() to force delivery of IMSG_DELETE_ADDRESS to
privileged process. This ensures a quicker exit of any previous
copy of dhclient.
Prodded by deraadt@
-rw-r--r-- | sbin/dhclient/kroute.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index 12ee0ff4efe..9a73434bf07 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.37 2013/02/18 22:10:04 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.38 2013/02/21 14:10:22 krw Exp $ */ /* * Copyright 2012 Kenneth R Westerback <krw@openbsd.org> @@ -393,9 +393,13 @@ delete_address(char *ifname, int rdomain, struct in_addr addr) rslt = imsg_compose(unpriv_ibuf, IMSG_DELETE_ADDRESS, 0, 0 , -1, &imsg, sizeof(imsg)); - if (rslt == -1) warning("delete_address: imsg_compose: %s", strerror(errno)); + + /* Do flush to quickly kill previous dhclient, if any. */ + rslt = imsg_flush(unpriv_ibuf); + if (rslt == -1 && errno != EPIPE) + warning("delete_address: imsg_flush: %s", strerror(errno)); } void |