]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile and warnings on Linux for prior patch.
authorRoy Marples <roy@marples.name>
Fri, 1 May 2015 09:52:04 +0000 (09:52 +0000)
committerRoy Marples <roy@marples.name>
Fri, 1 May 2015 09:52:04 +0000 (09:52 +0000)
arp.c
dhcp.c
if-linux.c
if.c

diff --git a/arp.c b/arp.c
index 4877a65f31a4cef73654f50fb1f2b65ce7ce52dc..614a7b66323ed299b4efc1c9970f2c499d20066d 100644 (file)
--- 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 2c962a2da2cffab00f843da9966a2f21d04710cd..08b75eaac6aeba4fa27fa3e87ae99ab3ed05d32c 100644 (file)
--- 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
index f99de8d946dacf25d95b35589da0c5564a85670d..5ed0e5b32c80b10eb59d63cc4ab06168f5b15775 100644 (file)
@@ -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 c2cc4ae2d3580157f72f99f55beae241153cd18d..308b7f9f30d3998ea021c792524ce820975ddea8 100644 (file)
--- 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__