Small SLAAC optimisation.

This commit is contained in:
Simon Kelley
2012-04-28 17:42:31 +01:00
parent a9ab732e35
commit 7f61b3ad59

View File

@@ -27,6 +27,7 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force)
{ {
struct slaac_address *slaac, *old, **up; struct slaac_address *slaac, *old, **up;
struct dhcp_context *context; struct dhcp_context *context;
int dns_dirty = 0;
if (!(lease->flags & LEASE_HAVE_HWADDR) || if (!(lease->flags & LEASE_HAVE_HWADDR) ||
(lease->flags & (LEASE_TA | LEASE_NA)) || (lease->flags & (LEASE_TA | LEASE_NA)) ||
@@ -78,7 +79,7 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force)
{ {
slaac->ping_time = now; slaac->ping_time = now;
slaac->backoff = 1; slaac->backoff = 1;
lease_update_dns(1); dns_dirty = 1;
} }
break; break;
} }
@@ -103,6 +104,9 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force)
} }
} }
if (old || dns_dirty)
lease_update_dns(1);
/* Free any no reused */ /* Free any no reused */
for (; old; old = slaac) for (; old; old = slaac)
{ {