]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Extending dhcp lease on expire should respect ARP being disabled.
authorRoy Marples <roy@marples.name>
Fri, 29 Apr 2016 23:09:40 +0000 (23:09 +0000)
committerRoy Marples <roy@marples.name>
Fri, 29 Apr 2016 23:09:40 +0000 (23:09 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index e4baa03db086631901c9318b5e682839779a01dd..15fba78850d8af4d3c8cf8b96ceb499e0a02f183 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1812,17 +1812,23 @@ dhcp_request(void *arg)
 static int
 dhcp_leaseextend(struct interface *ifp)
 {
-       struct arp_state *astate;
 
-       if ((astate = arp_new(ifp, NULL)) == NULL)
-               return -1;
+       if (ifp->options->options & DHCPCD_ARP) {
+               struct arp_state *astate;
 
-       if (arp_open(ifp) == -1)
-               return -1;
+               if ((astate = arp_new(ifp, NULL)) == NULL)
+                       return -1;
 
-       astate->conflicted_cb = dhcp_arp_conflicted;
-       logger(ifp->ctx, LOG_WARNING,
-           "%s: keeping lease until DaD failure or DHCP", ifp->name);
+               if (arp_open(ifp) == -1)
+                       return -1;
+
+               astate->conflicted_cb = dhcp_arp_conflicted;
+               logger(ifp->ctx, LOG_WARNING,
+                   "%s: extending lease until DaD failure or DHCP", ifp->name);
+               return 0;
+       }
+
+       logger(ifp->ctx, LOG_WARNING, "%s: extending lease", ifp->name);
        return 0;
 }