]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix existing address detection.
authorRoy Marples <roy@marples.name>
Mon, 27 Apr 2009 14:00:39 +0000 (14:00 +0000)
committerRoy Marples <roy@marples.name>
Mon, 27 Apr 2009 14:00:39 +0000 (14:00 +0000)
dhcpcd.c
net.c

index 11107daf2e51c2a0d70ceb7b783a0ff45767126f..e4f0c511cbbee607d3c39e3e2c69ea325ddc1501 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -562,7 +562,7 @@ handle_dhcp(struct interface *iface, struct dhcp_message **dhcpp)
                /* If the interface already has the address configured
                 * then we can't ARP for duplicate detection. */
                addr.s_addr = state->offer->yiaddr;
-               if (!has_address(iface->name, &addr, NULL)) {
+               if (has_address(iface->name, &addr, NULL) != 1) {
                        state->claims = 0;
                        state->probes = 0;
                        state->conflicts = 0;
diff --git a/net.c b/net.c
index 432398d194913255fb4afb54ada241c7f80be78d..bce10d19560ea0b993d5b523c785754f3dd2ddff 100644 (file)
--- a/net.c
+++ b/net.c
@@ -375,8 +375,8 @@ do_address(const char *ifname,
                if (ifa->ifa_addr->sa_family != AF_INET ||
                    strcmp(ifa->ifa_name, ifname) != 0)
                        continue;
-               a = (const struct sockaddr_in *)(void *)&ifa->ifa_addr;
-               n = (const struct sockaddr_in *)(void *)&ifa->ifa_netmask;
+               a = (const struct sockaddr_in *)(void *)ifa->ifa_addr;
+               n = (const struct sockaddr_in *)(void *)ifa->ifa_netmask;
                if (ifa->ifa_flags & IFF_POINTOPOINT)
                        d = (const struct sockaddr_in *)(void *)
                                &ifa->ifa_dstaddr;