EthernetFace: avoid putting the NIC in promiscuous mode if possible.
Try to use the PACKET_ADD_MEMBERSHIP socket option and the
SIOCADDMULTI ioctl, and only if they fail or are not available
we fall back to promiscuous mode.
Change-Id: Ib534e161ff86ca855e084240b94a166bc4d33ce1
Refs: #1278
diff --git a/daemon/face/ethernet-face.hpp b/daemon/face/ethernet-face.hpp
index 4383246..0c673c3 100644
--- a/daemon/face/ethernet-face.hpp
+++ b/daemon/face/ethernet-face.hpp
@@ -87,6 +87,9 @@
setPacketFilter(const char* filterString);
void
+ joinMulticastGroup();
+
+ void
sendPacket(const ndn::Block& block);
void
@@ -101,6 +104,9 @@
private:
shared_ptr<boost::asio::posix::stream_descriptor> m_socket;
+#if defined(__linux__)
+ int m_interfaceIndex;
+#endif
std::string m_interfaceName;
ethernet::Address m_srcAddress;
ethernet::Address m_destAddress;