summaryrefslogtreecommitdiff
path: root/sbin/dhclient/privsep.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-01-27 02:45:47 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-01-27 02:45:47 +0000
commit7916201b604eca6f61e23485c3bb6cf41fb93e44 (patch)
treec48bed3edae12da3ddb9510f760aae7600a36f50 /sbin/dhclient/privsep.c
parent8d6479d68203c38f0bf1bc8233b57ca97ee3be7c (diff)
Refactor code a bit. Calculate resolv.conf contents once when binding a
lease and reuse as required whenever resolv.conf is written. Use write_file() rather than a custom message/functions to write out resolv.conf.
Diffstat (limited to 'sbin/dhclient/privsep.c')
-rw-r--r--sbin/dhclient/privsep.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sbin/dhclient/privsep.c b/sbin/dhclient/privsep.c
index 1432bee17a2..70e9ca0a649 100644
--- a/sbin/dhclient/privsep.c
+++ b/sbin/dhclient/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.28 2013/01/15 21:44:28 krw Exp $ */
+/* $OpenBSD: privsep.c,v 1.29 2013/01/27 02:45:46 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -25,10 +25,10 @@
void
dispatch_imsg(struct imsgbuf *ibuf)
{
- struct imsg imsg;
- struct imsg_write_file *wfimsg;
- ssize_t n;
- size_t len;
+ struct imsg imsg;
+ struct imsg_write_file *wfimsg;
+ ssize_t n;
+ size_t len;
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
@@ -71,14 +71,6 @@ dispatch_imsg(struct imsgbuf *ibuf)
priv_add_default_route(imsg.data);
break;
- case IMSG_NEW_RESOLV_CONF:
- if (imsg.hdr.len != IMSG_HEADER_SIZE +
- sizeof(struct imsg_resolv_conf))
- warning("bad IMSG_NEW_RESOLV_CONF");
- else
- priv_resolv_conf(imsg.data);
- break;
-
case IMSG_CLEANUP:
if (imsg.hdr.len != IMSG_HEADER_SIZE +
sizeof(struct imsg_cleanup))