]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow IPv4LL to qualify an added address.
authorRoy Marples <roy@marples.name>
Sun, 14 Jun 2015 14:42:24 +0000 (14:42 +0000)
committerRoy Marples <roy@marples.name>
Sun, 14 Jun 2015 14:42:24 +0000 (14:42 +0000)
ipv4.c

diff --git a/ipv4.c b/ipv4.c
index 657a3089277d36bf615a4d5a652622a5af93768f..9dc5f1ac917f213dfbecab85e384f2e10ff651e7 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -160,12 +160,15 @@ ipv4_findaddr(struct dhcpcd_ctx *ctx, const struct in_addr *addr)
 int
 ipv4_hasaddr(const struct interface *ifp)
 {
-       const struct dhcp_state *state;
-
-       state = D_CSTATE(ifp);
-       return (state &&
-           state->added == STATE_ADDED &&
-           state->addr.s_addr != INADDR_ANY);
+       const struct dhcp_state *dstate;
+       const struct ipv4ll_state *istate;
+
+       dstate = D_CSTATE(ifp);
+       istate = IPV4LL_CSTATE(ifp);
+       return ((dstate &&
+           dstate->added == STATE_ADDED &&
+           dstate->addr.s_addr != INADDR_ANY) ||
+           (istate && istate->addr.s_addr != INADDR_ANY));
 }
 
 void