From: Roy Marples Date: Mon, 28 Jul 2014 09:15:04 +0000 (+0000) Subject: Test no useable IA in each lease validation. X-Git-Tag: v6.4.3~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bdcd382942c88ad1406d4f2aa6364855ce097d0;p=thirdparty%2Fdhcpcd.git Test no useable IA in each lease validation. --- diff --git a/dhcp6.c b/dhcp6.c index ea11f4f6..e77f793e 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -1955,6 +1955,7 @@ dhcp6_validatelease(struct interface *ifp, const char *sfrom) { struct dhcp6_state *state; + int nia; if (len <= sizeof(*m)) { syslog(LOG_ERR, "%s: DHCPv6 lease truncated", ifp->name); @@ -1967,7 +1968,13 @@ dhcp6_validatelease(struct interface *ifp, state->renew = state->rebind = state->expire = 0; state->lowpl = ND6_INFINITE_LIFETIME; - return dhcp6_findia(ifp, m, len, sfrom); + nia = dhcp6_findia(ifp, m, len, sfrom); + if (nia == 0) { + syslog(LOG_ERR, "%s: no useable IA found in lease", + ifp->name); + return -1; + } + return nia; } static ssize_t @@ -2037,11 +2044,6 @@ dhcp6_readlease(struct interface *ifp) fd = dhcp6_validatelease(ifp, state->new, state->new_len, NULL); if (fd == -1) goto ex; - if (fd == 0) { - syslog(LOG_INFO, "%s: no useable IA found in lease", - ifp->name); - goto ex; - } if (state->expire != ND6_INFINITE_LIFETIME) { gettimeofday(&now, NULL);