shill: DHCPConfig: Don't crash if proxy_ is NULL in RenewIP
Now that we call RenewIP on resume-from-suspend, we need to
catch cases where proxy_ is NULL in this call, since it is
possible that we have not acquired the proxy by the time we
go into suspend.
BUG=chromium-os:33648
TEST=New expectation in unit test.
Change-Id: Iefe01ec5500d0223cd65ec295023193e25f63cdd
Reviewed-on: https://gerrit.chromium.org/gerrit/30791
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/dhcp_config.cc b/dhcp_config.cc
index 0924ea2..05cbdb5 100644
--- a/dhcp_config.cc
+++ b/dhcp_config.cc
@@ -109,6 +109,10 @@
if (!pid_) {
return false;
}
+ if (!proxy_.get()) {
+ LOG(ERROR) << "Unable to renew IP before acquiring destination.";
+ return false;
+ }
proxy_->Rebind(device_name());
StartDHCPTimeout();
return true;