shill: Assign "Default" status to the best connection
Set the highest-ranked connection to be the "Default".
As a result, the highest priority default route will
move with the highest-ranked connection in the service
list.
Bonus changes:
* Service now formally holds a reference to the Connection
object, so call a "SetConnection" method instead of a
Create/Destroy of the HTTPProxy.
* Actually start the routing table service, and do a couple
minor fixes due to how the kernel actually accepts metric
changes.
BUG=chromium-os:7607,chromium-os:23993
TEST=New Unit Test + Manual (watch routes while inserting
USB-Ethernet on a machine connected to WiFi)
Change-Id: Iddf1ed766238d9e8adc97bb54fc12b527f86239f
Reviewed-on: https://gerrit.chromium.org/gerrit/12685
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/connection.h b/connection.h
index 00e61f3..f99447d 100644
--- a/connection.h
+++ b/connection.h
@@ -31,12 +31,12 @@
// Add the contents of an IPConfig reference to the list of managed state.
// This will replace all previous state for this address family.
- void UpdateFromIPConfig(const IPConfigRefPtr &config);
+ virtual void UpdateFromIPConfig(const IPConfigRefPtr &config);
// Sets the current connection as "default", i.e., routes and DNS entries
// should be used by all system components that don't select explicitly.
bool is_default() const { return is_default_; }
- void SetDefault(bool is_default);
+ virtual void SetIsDefault(bool is_default);
const std::string &interface_name() const { return interface_name_; }
const std::vector<std::string> &dns_servers() const { return dns_servers_; }