Shuffle sendhup() into dispatch.c, the only place it is used.
authorkrw <krw@openbsd.org>
Wed, 5 Apr 2017 18:22:30 +0000 (18:22 +0000)
committerkrw <krw@openbsd.org>
Wed, 5 Apr 2017 18:22:30 +0000 (18:22 +0000)
sbin/dhclient/dhcpd.h
sbin/dhclient/dispatch.c
sbin/dhclient/kroute.c

index 1aae45d..9b98f9b 100644 (file)
@@ -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 *);
index 2165c0f..0361c3d 100644 (file)
@@ -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");
+}
index d93c164..1d53f81 100644 (file)
@@ -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>
@@ -512,28 +512,6 @@ priv_add_address(struct interface_info *ifi, struct imsg_add_address *imsg)
        active_addr = imsg->addr;
 }
 
-/*
- * 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.
  */