changeset 5490:df4ea0197ce8 draft

BSD: Fix compile for non NetBSD
author Roy Marples <roy@marples.name>
date Wed, 30 Sep 2020 16:14:39 +0100
parents a3d5af47a4e3
children 6cd47402148f
files src/dhcpcd.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcpcd.c	Tue Sep 29 08:00:24 2020 +0100
+++ b/src/dhcpcd.c	Wed Sep 30 16:14:39 2020 +0100
@@ -765,7 +765,7 @@
 			/* BSD does not emit RTM_NEWADDR or RTM_CHGADDR when the
 			 * hardware address changes so we have to go
 			 * through the disovery process to work it out. */
-			dhcpcd_handleinterface(ctx, 0, ifp->name);
+			dhcpcd_handleinterface(ifp->ctx, 0, ifp->name);
 #endif
 			if (ifp->wireless) {
 				uint8_t ossid[IF_SSIDLEN];
@@ -1017,14 +1017,13 @@
 int
 dhcpcd_handleinterface(void *arg, int action, const char *ifname)
 {
-	struct dhcpcd_ctx *ctx;
+	struct dhcpcd_ctx *ctx = arg;
 	struct ifaddrs *ifaddrs;
 	struct if_head *ifs;
 	struct interface *ifp, *iff;
 	const char * const argv[] = { ifname };
 	int e;
 
-	ctx = arg;
 	if (action == -1) {
 		ifp = if_find(ctx->ifaces, ifname);
 		if (ifp == NULL) {