From: Roy Marples Date: Fri, 29 Apr 2016 23:09:40 +0000 (+0000) Subject: Extending dhcp lease on expire should respect ARP being disabled. X-Git-Tag: v6.11.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9e8c48af1bc1fa153a5798759b972de3ac85633;p=thirdparty%2Fdhcpcd.git Extending dhcp lease on expire should respect ARP being disabled. --- diff --git a/dhcp.c b/dhcp.c index e4baa03d..15fba788 100644 --- 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; }