diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-04-05 18:22:32 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-04-05 18:22:32 +0000 |
commit | d44e6b45ccf0e79cbf0f1e3f55b8bc47cc8950e2 (patch) | |
tree | 89078ac59a8261ac1eee1748cc002b914fa183be /sbin | |
parent | 2a24af8706127913d791cf1272a14317d01608a6 (diff) |
Shuffle sendhup() into dispatch.c, the only place it is used.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhcpd.h | 4 | ||||
-rw-r--r-- | sbin/dhclient/dispatch.c | 25 | ||||
-rw-r--r-- | sbin/dhclient/kroute.c | 24 |
3 files changed, 26 insertions, 27 deletions
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index 1aae45d1a2f..9b98f9b36cf 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.164 2017/04/04 15:15:48 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.165 2017/04/05 18:22:30 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@openbsd.org> @@ -279,6 +279,4 @@ void add_route(struct in_addr, struct in_addr, struct in_addr, struct in_addr, int resolv_conf_priority(struct interface_info *); -void sendhup(struct client_lease *); - void flush_unpriv_ibuf(const char *); diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 2165c0f19f2..0361c3de511 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.118 2017/04/04 15:15:48 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.119 2017/04/05 18:22:30 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -73,6 +73,7 @@ struct dhcp_timeout timeout; void packethandler(struct interface_info *ifi); +void sendhup(struct client_lease *); void get_hw_address(struct interface_info *ifi) @@ -338,3 +339,25 @@ get_rdomain(char *name) close(s); return rv; } + +/* + * Inform the [priv] process a HUP was received and it should restart. + */ +void +sendhup(struct client_lease *active) +{ + struct imsg_hup imsg; + int rslt; + + if (active) + imsg.addr = active->address; + else + imsg.addr.s_addr = INADDR_ANY; + + rslt = imsg_compose(unpriv_ibuf, IMSG_HUP, 0, 0, -1, + &imsg, sizeof(imsg)); + if (rslt == -1) + log_warn("sendhup: imsg_compose"); + + flush_unpriv_ibuf("sendhup"); +} diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index d93c164b666..1d53f814b51 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.85 2017/03/08 15:07:32 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.86 2017/04/05 18:22:31 krw Exp $ */ /* * Copyright 2012 Kenneth R Westerback <krw@openbsd.org> @@ -513,28 +513,6 @@ priv_add_address(struct interface_info *ifi, struct imsg_add_address *imsg) } /* - * Inform the [priv] process a HUP was received and it should restart. - */ -void -sendhup(struct client_lease *active) -{ - struct imsg_hup imsg; - int rslt; - - if (active) - imsg.addr = active->address; - else - imsg.addr.s_addr = INADDR_ANY; - - rslt = imsg_compose(unpriv_ibuf, IMSG_HUP, 0, 0, -1, - &imsg, sizeof(imsg)); - if (rslt == -1) - log_warn("sendhup: imsg_compose"); - - flush_unpriv_ibuf("sendhup"); -} - -/* * priv_cleanup removes dhclient installed routes and address. */ void |