shill: connection: Allow missing broadcast
Teunnel interfaces do not have a broadcast address since they
are p-t-p. Hand the Connection object a technology identifier
so it can make such decisions. We may need to explore polymorphism
in the future if decisions of this sort become more prevalent.
BUG=chromium-os:27929
TEST=Unit tests
Change-Id: I1a81d010c60319015bf0ac690baf3edb62a39cdf
Reviewed-on: https://gerrit.chromium.org/gerrit/18361
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
diff --git a/connection_unittest.cc b/connection_unittest.cc
index d43bd69..728f347 100644
--- a/connection_unittest.cc
+++ b/connection_unittest.cc
@@ -57,6 +57,7 @@
connection_(new Connection(
kTestDeviceInterfaceIndex0,
kTestDeviceName0,
+ Technology::kUnknown,
device_info_.get())),
ipconfig_(new IPConfig(&control_, kTestDeviceName0)) {}
@@ -180,6 +181,7 @@
TEST_F(ConnectionTest, RouteRequest) {
ConnectionRefPtr connection(new Connection(kTestDeviceInterfaceIndex0,
kTestDeviceName0,
+ Technology::kUnknown,
device_info_.get()));
ReplaceSingletons(connection);
scoped_refptr<MockDevice> device(new StrictMock<MockDevice>(
@@ -216,6 +218,7 @@
{
ConnectionRefPtr connection(new Connection(kTestDeviceInterfaceIndex1,
kTestDeviceName1,
+ Technology::kUnknown,
device_info_.get()));
connection->resolver_ = &resolver_;
connection->routing_table_ = &routing_table_;
@@ -232,6 +235,7 @@
TEST_F(ConnectionTest, RequestHostRoute) {
ConnectionRefPtr connection(new Connection(kTestDeviceInterfaceIndex0,
kTestDeviceName0,
+ Technology::kUnknown,
device_info_.get()));
ReplaceSingletons(connection);
IPAddress address(IPAddress::kFamilyIPv4);