]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix build without ARP and/or ARPING
authorRoy Marples <roy@marples.name>
Wed, 24 Jul 2019 18:33:10 +0000 (19:33 +0100)
committerRoy Marples <roy@marples.name>
Wed, 24 Jul 2019 18:33:10 +0000 (19:33 +0100)
src/dhcp.c
src/ipv4.c

index b2da83a7d32cf513f23da6726d46d707953090c0..20eaeab7cb84bf3adb8b0443296336c20b3d1d83 100644 (file)
@@ -2032,13 +2032,15 @@ static void
 dhcp_arp_not_found(struct arp_state *astate)
 {
        struct interface *ifp;
+#ifdef ARPING
        struct dhcp_state *state;
        struct if_options *ifo;
+#endif
 
        ifp = astate->iface;
+#ifdef ARPING
        state = D_STATE(ifp);
        ifo = ifp->options;
-#ifdef ARPING
        if (ifo->arping_len && state->arping_index < ifo->arping_len) {
                /* We didn't find a profile for this
                 * address or hwaddr, so move to the next
@@ -2062,12 +2064,11 @@ static void
 dhcp_arp_found(struct arp_state *astate, const struct arp_msg *amsg)
 {
        struct in_addr addr;
+       struct interface *ifp = astate->iface;
 #ifdef ARPING
-       struct interface *ifp;
        struct dhcp_state *state;
        struct if_options *ifo;
 
-       ifp = astate->iface;
        state = D_STATE(ifp);
 
        ifo = ifp->options;
@@ -2093,6 +2094,8 @@ dhcp_arp_found(struct arp_state *astate, const struct arp_msg *amsg)
                dhcpcd_startinterface(ifp);
                return;
        }
+#else
+       UNUSED(amsg);
 #endif
 
        addr = astate->addr;
index 7b510f982380b8a2551c411d155e3ec12d5f2f02..0618da07246390c0b9682238e9c18679291847db 100644 (file)
@@ -502,6 +502,8 @@ ipv4_deladdr(struct ipv4_addr *addr, int keeparp)
 #ifdef ARP
        if (!keeparp)
                arp_freeaddr(addr->iface, &addr->addr);
+#else
+       UNUSED(keeparp);
 #endif
 
        state = IPV4_STATE(addr->iface);
@@ -539,7 +541,9 @@ delete_address(struct interface *ifp)
            ifo->options & DHCPCD_INFORM ||
            (ifo->options & DHCPCD_STATIC && ifo->req_addr.s_addr == 0))
                return 0;
+#ifdef ARP
        arp_freeaddr(ifp, &state->addr->addr);
+#endif
        r = ipv4_deladdr(state->addr, 0);
        return r;
 }