shill: DhcpConfig: Vacate lease if it expires
If the DHCP client fails to renew a lease, we should disconnect
the service, and stop using the IP address. We implement this
by adding a timer to the DHCPConfig that re-starts the DHCP
instance if the lease is not renewed before the lease expires.
This covers a variety of situations where the DHCP client was
unable to acquire a lease in time:
- The DHCP server was actively denying a renewal
- The DHCP server stopped responding responding
- The DHCP client encountered some failure but didn't exit
By restarting the DHCP instance, we start a fresh DHCP process
with a new acquisition timer. If this acquisition process times
out the service will disconnect with a DHCP failure.
BUG=chromium:216710
TEST=Unit tests; modified network_DhcpRenew autotest (CL:181069)
Change-Id: I63037246f9fefca65a4c0f5ca30a29ac39a51662
Reviewed-on: https://chromium-review.googlesource.com/181133
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/metrics.h b/metrics.h
index 1c9f776..6476b6a 100644
--- a/metrics.h
+++ b/metrics.h
@@ -428,6 +428,13 @@
// implies an infrastructure issue.
static const char kMetricDHCPOptionFailureDetected[];
+ // The length in seconds of a lease that has expired while the DHCP
+ // client was attempting to renew the lease..
+ static const char kMetricExpiredLeaseLengthSeconds[];
+ static const int kMetricExpiredLeaseLengthSecondsMax;
+ static const int kMetricExpiredLeaseLengthSecondsMin;
+ static const int kMetricExpiredLeaseLengthSecondsNumBuckets;
+
explicit Metrics(EventDispatcher *dispatcher);
virtual ~Metrics();