face: Ignoring fireware interfaces (fw*) in EthernetChannelFactory
Change-Id: Ibfb512ce1229e74eee4c66efd87d6dc4a18c057e
diff --git a/daemon/face/ethernet-channel-factory.cpp b/daemon/face/ethernet-channel-factory.cpp
index 4c47f85..86ad1a5 100644
--- a/daemon/face/ethernet-channel-factory.cpp
+++ b/daemon/face/ethernet-channel-factory.cpp
@@ -70,6 +70,9 @@
boost::starts_with(interface, "nfqueue"))
// ignore Linux netfilter devices
continue;
+ if (boost::starts_with(interface, "fw"))
+ // ignore OSX firewire interface
+ continue;
// maybe add interface addresses too
// interface.addAddress ...
diff --git a/tests/face/ethernet.cpp b/tests/face/ethernet.cpp
index cd84008..f03cb68 100644
--- a/tests/face/ethernet.cpp
+++ b/tests/face/ethernet.cpp
@@ -21,16 +21,19 @@
std::vector<ethernet::Endpoint> interfaces = EthernetChannelFactory::findAllInterfaces();
if (interfaces.size() > 0)
{
- shared_ptr<EthernetFace> face1 = factory.createMulticast(interfaces[0],
- ethernet::getBroadcastAddress());
- shared_ptr<EthernetFace> face1bis = factory.createMulticast(interfaces[0],
- ethernet::getBroadcastAddress());
+ shared_ptr<EthernetFace> face1;
+ BOOST_REQUIRE_NO_THROW(face1 = factory.createMulticast(interfaces[0],
+ ethernet::getBroadcastAddress()));
+ shared_ptr<EthernetFace> face1bis;
+ BOOST_REQUIRE_NO_THROW(face1bis = factory.createMulticast(interfaces[0],
+ ethernet::getBroadcastAddress()));
BOOST_CHECK_EQUAL(face1, face1bis);
if (interfaces.size() > 1)
{
- shared_ptr<EthernetFace> face2 = factory.createMulticast(interfaces[1],
- ethernet::getBroadcastAddress());
+ shared_ptr<EthernetFace> face2;
+ BOOST_REQUIRE_NO_THROW(face2 = factory.createMulticast(interfaces[1],
+ ethernet::getBroadcastAddress()));
BOOST_CHECK_NE(face1, face2);
}
else
@@ -39,8 +42,9 @@
"only one interface available for pcap");
}
- shared_ptr<EthernetFace> face3 = factory.createMulticast(interfaces[0],
- ethernet::getDefaultMulticastAddress());
+ shared_ptr<EthernetFace> face3;
+ BOOST_REQUIRE_NO_THROW(face3 = factory.createMulticast(interfaces[0],
+ ethernet::getDefaultMulticastAddress()));
BOOST_CHECK_NE(face1, face3);
}
else