]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: Fix compile
authorRoy Marples <roy@marples.name>
Fri, 19 Apr 2019 08:07:13 +0000 (09:07 +0100)
committerRoy Marples <roy@marples.name>
Fri, 19 Apr 2019 08:07:13 +0000 (09:07 +0100)
src/dhcp.c
src/ipv4ll.c

index f20c73fa3ba2f913d319b52feed87f55fde8e1fa..cb1577a158a996dd03ac3c551d6ebfe198b6b9c9 100644 (file)
@@ -2034,7 +2034,7 @@ dhcp_finish_dad(struct interface *ifp, struct in_addr *ia)
                state->new = state->offer;
                state->new_len = state->offer_len;
                get_lease(ifp, &state->lease, state->new, state->new_len);
-               ipv4_applyaddr(astate->iface);
+               ipv4_applyaddr(ifp);
                state->new = bootp;
                state->new_len = len;
        }
@@ -2114,6 +2114,7 @@ dhcp_arp_not_found(struct arp_state *astate)
 static void
 dhcp_arp_found(struct arp_state *astate, const struct arp_msg *amsg)
 {
+       struct in_addr addr;
 #ifdef ARPING
        struct interface *ifp;
        struct dhcp_state *state;
@@ -2147,7 +2148,9 @@ dhcp_arp_found(struct arp_state *astate, const struct arp_msg *amsg)
        }
 #endif
 
-       dhcp_addr_duplicated(astate->iface, &astate->addr);
+       addr = astate->addr;
+       arp_free(astate);
+       dhcp_addr_duplicated(astate->iface, &addr);
 }
 
 #ifdef KERNEL_RFC5227
index 81919befce451e0722d44622870cba7b61730907..8808aebaf434aa87ca910eff5e8b076981678ec2 100644 (file)
@@ -173,7 +173,7 @@ ipv4ll_env(char **env, const char *prefix, const struct interface *ifp)
 }
 
 static void
-ipv4ll_announced(struct arp_state *astate)
+ipv4ll_announced_arp(struct arp_state *astate)
 {
        struct ipv4ll_state *state = IPV4LL_STATE(astate->iface);
 
@@ -198,7 +198,9 @@ ipv4ll_not_found(struct interface *ifp)
 {
        struct ipv4ll_state *state;
        struct ipv4_addr *ia;
+#ifdef KERNEL_RFC5227
        struct arp_state *astate;
+#endif
 
        state = IPV4LL_STATE(ifp);
        assert(state != NULL);
@@ -235,12 +237,12 @@ test:
 #ifdef KERNEL_RFC5227
        astate = arp_new(ifp, &ia->addr);
        if (astate != NULL) {
-               astate->announced_cb = ipv4ll_announced;
+               astate->announced_cb = ipv4ll_announced_arp;
                astate->free_cb = ipv4ll_arpfree;
                arp_announce(astate);
        }
 #else
-       arp_annnounce(state->arp);
+       arp_announce(state->arp);
 #endif
        script_runreason(ifp, "IPV4LL");
        dhcpcd_daemonise(ifp->ctx);
@@ -291,7 +293,6 @@ ipv4ll_not_found_arp(struct arp_state *astate)
 {
        struct interface *ifp;
        struct ipv4ll_state *state;
-       struct ipv4_addr *ia;
 
        assert(astate != NULL);
        assert(astate->iface != NULL);
@@ -300,7 +301,7 @@ ipv4ll_not_found_arp(struct arp_state *astate)
        state = IPV4LL_STATE(ifp);
        assert(state != NULL);
        assert(state->arp == astate);
-       ipv4ll_not_found_arp(state);
+       ipv4ll_not_found_arp(astate);
 }
 
 static void
@@ -316,10 +317,10 @@ ipv4ll_found_arp(struct arp_state *astate, __unused const struct arp_msg *amsg)
 static void
 ipv4ll_defend_failed_arp(struct arp_state *astate)
 {
-       struct ipv4ll_state *state = IPV4LL_STATE(astate->ifp);
+       struct ipv4ll_state *state = IPV4LL_STATE(astate->iface);
 
        assert(state->arp == astate);
-       ipv4ll_defend_failed1(astate->iface);
+       ipv4ll_defend_failed(astate->iface);
 }
 #endif