]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix IPv4LL on NetBSD when wifi reconfigures.
authorRoy Marples <roy@marples.name>
Fri, 7 Aug 2015 12:54:21 +0000 (12:54 +0000)
committerRoy Marples <roy@marples.name>
Fri, 7 Aug 2015 12:54:21 +0000 (12:54 +0000)
dhcp.c
dhcp.h
dhcpcd.c

diff --git a/dhcp.c b/dhcp.c
index 9a0a44c69f475cf9d549f61db34a8a9e760796fe..d95baa77e89f60709bd10a116e0d0429eeac292e 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -3342,13 +3342,8 @@ dhcp_start1(void *arg)
        }
 
        if (!(ifo->options & DHCPCD_DHCP)) {
-               if (ifo->options & DHCPCD_IPV4LL) {
-                       if (state->offer && state->offer->cookie != 0) {
-                               free(state->offer);
-                               state->offer = NULL;
-                       }
+               if (ifo->options & DHCPCD_IPV4LL)
                        ipv4ll_start(ifp);
-               }
                return;
        }
 
@@ -3385,6 +3380,13 @@ dhcp_start(struct interface *ifp)
        eloop_timeout_add_tv(ifp->ctx->eloop, &tv, dhcp_start1, ifp);
 }
 
+void
+dhcp_abort(struct interface *ifp)
+{
+
+       eloop_timeout_delete(ifp->ctx->eloop, dhcp_start1, ifp);
+}
+
 void
 dhcp_handleifa(int cmd, struct interface *ifp,
        const struct in_addr *addr,
diff --git a/dhcp.h b/dhcp.h
index 1495aafbd438d187d05472b7c7093f4ad8635dfd..4cd242f7be397640a27eeefe1873687931240b12 100644 (file)
--- a/dhcp.h
+++ b/dhcp.h
@@ -264,7 +264,7 @@ void dhcp_handleifa(int, struct interface *,
 
 void dhcp_drop(struct interface *, const char *);
 void dhcp_start(struct interface *);
-void dhcp_stop(struct interface *);
+void dhcp_abort(struct interface *);
 void dhcp_discover(void *);
 void dhcp_inform(struct interface *);
 void dhcp_bind(struct interface *);
@@ -275,6 +275,7 @@ int dhcp_dump(struct interface *);
 #else
 #define dhcp_drop(a, b) {}
 #define dhcp_start(a) {}
+#define dhcp_abort(a) {}
 #define dhcp_reboot(a, b) (b = b)
 #define dhcp_reboot_newopts(a, b) (b = b)
 #define dhcp_close(a) {}
index 0a3daf629bd5837c41b6d3525eb52e67d9786c86..9ea6c7ad7eb5c26227dccd605a535a43f34cc971 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -696,6 +696,7 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *ctx, int carrier, unsigned int flags,
                        script_runreason(ifp, "NOCARRIER");
 #ifdef NOCARRIER_PRESERVE_IP
                        arp_close(ifp);
+                       dhcp_abort(ifp);
                        if_sortinterfaces(ctx);
                        ipv4_preferanother(ifp);
                        ipv6nd_expire(ifp, 0);