From: Roy Marples Date: Fri, 1 May 2015 09:52:04 +0000 (+0000) Subject: Fix compile and warnings on Linux for prior patch. X-Git-Tag: v6.8.2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45e3b2fe7c83fa4d7b0542e1719430be8e1c0008;p=thirdparty%2Fdhcpcd.git Fix compile and warnings on Linux for prior patch. --- diff --git a/arp.c b/arp.c index 4877a65f..614a7b66 100644 --- a/arp.c +++ b/arp.c @@ -412,5 +412,10 @@ arp_handleifa(int cmd, struct interface *ifp, const struct in_addr *addr, } } } +#else + UNUSED(cmd); + UNUSED(ifp); + UNUSED(addr); + UNUSED(flags); #endif } diff --git a/dhcp.c b/dhcp.c index 2c962a2d..08b75eaa 100644 --- a/dhcp.c +++ b/dhcp.c @@ -3193,11 +3193,14 @@ dhcp_start1(void *arg) state->offer = read_lease(ifp); /* Check the saved lease matches the type we want */ if (state->offer) { - struct ipv4_addr *ia; +#ifdef IN_IFF_DUPLICATED struct in_addr addr; + struct ipv4_addr *ia; addr.s_addr = state->offer->yiaddr; ia = ipv4_iffindaddr(ifp, &addr, NULL); +#endif + if ((IS_BOOTP(ifp, state->offer) && !(ifo->options & DHCPCD_BOOTP)) || #ifdef IN_IFF_DUPLICATED diff --git a/if-linux.c b/if-linux.c index f99de8d9..5ed0e5b3 100644 --- a/if-linux.c +++ b/if-linux.c @@ -625,7 +625,7 @@ link_addr(struct dhcpcd_ctx *ctx, struct interface *ifp, struct nlmsghdr *nlm) rta = RTA_NEXT(rta, len); } ipv4_handleifa(ctx, nlm->nlmsg_type, NULL, ifp->name, - &addr, &net, &dest); + &addr, &net, &dest, ifa->ifa_flags); break; #endif #ifdef INET6 diff --git a/if.c b/if.c index c2cc4ae2..308b7f9f 100644 --- a/if.c +++ b/if.c @@ -478,6 +478,8 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_addr == NULL) continue; + if ((ifp = if_find(ifs, ifa->ifa_name)) == NULL) + continue; switch(ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: @@ -499,12 +501,6 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) #endif #ifdef INET6 case AF_INET6: - TAILQ_FOREACH(ifp, ifs, next) { - if (strcmp(ifp->name, ifa->ifa_name) == 0) - break; - } - if (ifp == NULL) - break; /* Should be impossible */ sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; net6 = (struct sockaddr_in6 *)(void *)ifa->ifa_netmask; #ifdef __KAME__