face: Ignoring fireware interfaces (fw*) in EthernetChannelFactory

Change-Id: Ibfb512ce1229e74eee4c66efd87d6dc4a18c057e
This commit is contained in:
Alexander Afanasyev committed 2014-02-27 21:25:33 -08:00
1 parent d9ee45c952
commit ef968e15d5
2 files changed
+15 -8

No files matched your search

+3
View File
@@ -70,6 +70,9 @@ EthernetChannelFactory::findAllInterfaces()
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 ...
+12 -8
View File
@@ -21,16 +21,19 @@ BOOST_AUTO_TEST_CASE(MulticastFacesMap)
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 @@ BOOST_AUTO_TEST_CASE(MulticastFacesMap)
"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