From 854d2340776a69561a335f09da3f01ae0d96bf4a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 19 Apr 2019 09:07:13 +0100 Subject: [PATCH] Linux: Fix compile --- src/dhcp.c | 7 +++++-- src/ipv4ll.c | 15 ++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/dhcp.c b/src/dhcp.c index f20c73fa..cb1577a1 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -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 diff --git a/src/ipv4ll.c b/src/ipv4ll.c index 81919bef..8808aeba 100644 --- a/src/ipv4ll.c +++ b/src/ipv4ll.c @@ -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 -- 2.47.3