diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp index ce8e4557..b00fa5fd 100644 --- a/daemon/face/ethernet-factory.cpp +++ b/daemon/face/ethernet-factory.cpp @@ -264,13 +264,18 @@ EthernetFactory::applyUnicastConfigToNetif(const shared_ptrgetType() != ndn::net::InterfaceType::ETHERNET) { + NFD_LOG_DEBUG("Not creating channel on " << netif->getName() << ": incompatible netif type"); + return nullptr; + } + if (!netif->isUp()) { NFD_LOG_DEBUG("Not creating channel on " << netif->getName() << ": netif is down"); return nullptr; } - if (netif->isLoopback()) { - NFD_LOG_DEBUG("Not creating channel on " << netif->getName() << ": netif is loopback"); + if (netif->getEthernetAddress().isNull()) { + NFD_LOG_DEBUG("Not creating channel on " << netif->getName() << ": invalid Ethernet address"); return nullptr; } @@ -293,6 +298,11 @@ EthernetFactory::applyMcastConfigToNetif(const ndn::net::NetworkInterface& netif return nullptr; } + if (netif.getType() != ndn::net::InterfaceType::ETHERNET) { + NFD_LOG_DEBUG("Not creating multicast face on " << netif.getName() << ": incompatible netif type"); + return nullptr; + } + if (!netif.isUp()) { NFD_LOG_DEBUG("Not creating multicast face on " << netif.getName() << ": netif is down"); return nullptr; @@ -303,6 +313,11 @@ EthernetFactory::applyMcastConfigToNetif(const ndn::net::NetworkInterface& netif return nullptr; } + if (netif.getEthernetAddress().isNull()) { + NFD_LOG_DEBUG("Not creating multicast face on " << netif.getName() << ": invalid Ethernet address"); + return nullptr; + } + if (!m_mcastConfig.netifPredicate(netif)) { NFD_LOG_DEBUG("Not creating multicast face on " << netif.getName() << ": rejected by whitelist/blacklist"); return nullptr;