diff options
| author | Roy Marples <roy@marples.name> | 2016-05-19 08:38:13 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-05-19 08:38:13 +0000 |
| commit | 0b51734a3b30955f5d0055831f83e13314d79dbd (patch) | |
| tree | d6a78bf76389128b9d975ac3c68e420bb80bab77 | |
| parent | 2117dd8d4a9245795086259be80b9e3615dae012 (diff) | |
| download | dhcpcd-0b51734a3b30955f5d0055831f83e13314d79dbd.tar.xz | |
Fix compile on NetBSD.
| -rw-r--r-- | arp.c | 6 | ||||
| -rw-r--r-- | dhcp.c | 9 | ||||
| -rw-r--r-- | ipv4ll.c | 2 |
3 files changed, 8 insertions, 9 deletions
@@ -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); } @@ -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 @@ -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 |
