From: Roy Marples Date: Thu, 19 May 2016 08:38:13 +0000 (+0000) Subject: Fix compile on NetBSD. X-Git-Tag: v6.11.1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b51734a3b30955f5d0055831f83e13314d79dbd;p=thirdparty%2Fdhcpcd.git Fix compile on NetBSD. --- diff --git a/arp.c b/arp.c index ad4eb8f4..5b35ccdd 100644 --- a/arp.c +++ b/arp.c @@ -431,15 +431,15 @@ arp_handleifa(int cmd, struct ipv4_addr *addr) struct iarp_state *state; struct arp_state *astate, *asn; - if (cmd != RTM_NEWADDR || (state = ARP_STATE(ifp)) == NULL) + if (cmd != RTM_NEWADDR || (state = ARP_STATE(addr->iface)) == NULL) return; TAILQ_FOREACH_SAFE(astate, &state->arp_states, next, asn) { if (astate->addr.s_addr == addr->addr.s_addr) { - if (flags & IN_IFF_DUPLICATED) { + if (addr->addr_flags & IN_IFF_DUPLICATED) { if (astate->conflicted_cb) astate->conflicted_cb(astate, NULL); - } else if (!(flags & IN_IFF_NOTUSEABLE)) { + } else if (!(addr->addr_flags & IN_IFF_NOTUSEABLE)) { if (astate->probed_cb) astate->probed_cb(astate); } diff --git a/dhcp.c b/dhcp.c index 878ddff1..63f31526 100644 --- a/dhcp.c +++ b/dhcp.c @@ -2076,9 +2076,8 @@ dhcp_arp_conflicted(struct arp_state *astate, const struct arp_msg *amsg) !state->lease.frominfo) dhcp_decline(ifp); #ifdef IN_IFF_DUPLICATED - ia = ipv4_iffindaddr(ifp, &astate->addr->addr, NULL); - if (ia) - ipv4_deladdr(ia->addr, 1); + if ((ia = ipv4_iffindaddr(ifp, &astate->addr, NULL)) != NULL) + ipv4_deladdr(ia, 1); #endif arp_free(astate); eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp); @@ -2918,7 +2917,7 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len, LOGDHCP(LOG_WARNING, "declined duplicate address"); if (type) dhcp_decline(ifp); - ipv4_deladdr(ifp, &ia->addr, &ia->mask, 0); + ipv4_deladdr(ia, 0); eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp); eloop_timeout_add_sec(ifp->ctx->eloop, DHCP_RAND_MAX, dhcp_discover, ifp); @@ -3626,7 +3625,7 @@ dhcp_handleifa(int cmd, struct ipv4_addr *ia) return; #ifdef IN_IFF_NOTUSEABLE - if (ia->flags & IN_IFF_NOTUSEABLE) + if (ia->addr_flags & IN_IFF_NOTUSEABLE) return; #endif diff --git a/ipv4ll.c b/ipv4ll.c index 287fb66b..9ad5ea39 100644 --- a/ipv4ll.c +++ b/ipv4ll.c @@ -378,7 +378,7 @@ ipv4ll_start(void *arg) ia = ipv4_iffindlladdr(ifp); #ifdef IN_IFF_TENTATIVE if (ia != NULL && ia->addr_flags & IN_IFF_DUPLICATED) { - ipv4_deladdr(ifp, &ia->addr, &ia->net, 0); + ipv4_deladdr(ia, 0); ia = NULL; } #endif