shill: IPConfig: Don't reset StaticIP on failure

If the IP address associated with an IPConfig is provided by
StaticIP, the entire configuration should be retained even if
the automatic configuration method fails.  Otherwise,
configuration parameters provided outside of the automatic
configuration mechanism will be lost.

To accomplish this cleanly, we need to change the contract
between IPConfig and Device objects.  The failure and success
events are now split into separate callbacks.  Intead of
passing a bool parameter to OnIPConfigUpdated, failure cases
are handled by a separate method.  Further, there is no
expectation in the failure case that the IPConfig resets
itself, so the IPConfig provides a public method for the
Device to call if it chooses.

BUG=chromium:318290
TEST=Unittest, new autotest network_DhcpFailureWithStaticIP (CL:179783)
All other network_Dhcp* unit tests run.

Change-Id: I55ed5a7adfc5d97e45ce832e25caab97ff39cea6
Reviewed-on: https://chromium-review.googlesource.com/179786
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/routing_table_unittest.cc b/routing_table_unittest.cc
index c38f960..d9391de 100644
--- a/routing_table_unittest.cc
+++ b/routing_table_unittest.cc
@@ -481,7 +481,7 @@
   IPConfig::Properties properties;
   properties.address_family = IPAddress::kFamilyIPv4;
   vector<IPConfig::Route> &routes = properties.routes;
-  ipconfig->UpdateProperties(properties, true);
+  ipconfig->UpdateProperties(properties);
 
   const int kMetric = 10;
   EXPECT_TRUE(routing_table_->ConfigureRoutes(kTestDeviceIndex0,
@@ -493,7 +493,7 @@
   route.netmask = kTestRemoteNetmask4;
   route.gateway = kTestGatewayAddress4;
   routes.push_back(route);
-  ipconfig->UpdateProperties(properties, true);
+  ipconfig->UpdateProperties(properties);
 
   IPAddress destination_address(IPAddress::kFamilyIPv4);
   IPAddress source_address(IPAddress::kFamilyIPv4);
@@ -526,7 +526,7 @@
   routes.push_back(route);
   route.host = kTestRemoteNetwork4;
   routes.push_back(route);
-  ipconfig->UpdateProperties(properties, true);
+  ipconfig->UpdateProperties(properties);
 
   EXPECT_CALL(rtnl_handler_,
               SendMessage(IsRoutingPacket(RTNLMessage::kModeAdd,