face: handle PcapHelper::Error when applying multicast configuration
When the network interface state is changed, NFD reconfigures its multicast ethernet faces. The code responsible for this is prone to a TOCTOU race condition, e.g., if an interface is quickly brought up and then down again. This currently raises an uncaught exception when we try to set a packet filter for that interface. Prevent this issue by catching PcapHelper errors in the same manner as we catch EthernetTransport errors, and skip creating the face. Refs: #5297 Change-Id: I9f91ac7c42dec06de34128cb34d6de8bb57e8cf5
This commit is contained in:
1 parent
1e0c88e184
commit
9c36a65b11
2 files changed
+14
-7
No files matched your search
@@ -1,14 +1,16 @@
|
|||||||
<aa@cs.fiu.edu> <alexander.afanasyev@ucla.edu>
|
<aa@cs.fiu.edu> <alexander.afanasyev@ucla.edu>
|
||||||
|
Alexander Lane <awlane@memphis.edu>
|
||||||
|
<chghasemi@cs.arizona.edu> <chavoosh.ghasemi@gmail.com>
|
||||||
<davidepesa@gmail.com> <davide.pesavento@lip6.fr>
|
<davidepesa@gmail.com> <davide.pesavento@lip6.fr>
|
||||||
<enewberry@email.arizona.edu> <enewberry@cs.arizona.edu>
|
<enewberry@email.arizona.edu> <enewberry@cs.arizona.edu>
|
||||||
Vince Lehman <vslehman@memphis.edu> <vlehman1@gmail.com>
|
|
||||||
<lybmath2009@gmail.com> <lybmath@ucla.edu>
|
|
||||||
Hila Ben Abraham <hilata@gmail.com>
|
|
||||||
<tuyukai1994@gmail.com> <tyk@bupt.edu.cn>
|
|
||||||
Haowei Yuan <hyuan@wustl.edu>
|
Haowei Yuan <hyuan@wustl.edu>
|
||||||
|
Hila Ben Abraham <hilata@gmail.com>
|
||||||
|
<lybmath2009@gmail.com> <lybmath@ucla.edu>
|
||||||
|
Md Ashiqur Rahman <marahman@email.arizona.edu>
|
||||||
Minsheng Zhang <jimmyzms5@gmail.com>
|
Minsheng Zhang <jimmyzms5@gmail.com>
|
||||||
Spyridon Mastorakis <spiros.mastorakis@gmail.com>
|
Spyridon Mastorakis <spiros.mastorakis@gmail.com>
|
||||||
Md Ashiqur Rahman <marahman@email.arizona.edu>
|
Susmit Shannigrahi <susmit@cs.colostate.edu>
|
||||||
Yumin Xia <me@yumin-xia.com>
|
|
||||||
<chghasemi@cs.arizona.edu> <chavoosh.ghasemi@gmail.com>
|
|
||||||
Tai-Lin Chu <tailinchu@gmail.com>
|
Tai-Lin Chu <tailinchu@gmail.com>
|
||||||
|
<tuyukai1994@gmail.com> <tyk@bupt.edu.cn>
|
||||||
|
Vince Lehman <vslehman@memphis.edu> <vlehman1@gmail.com>
|
||||||
|
Yumin Xia <me@yumin-xia.com>
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "ethernet-factory.hpp"
|
#include "ethernet-factory.hpp"
|
||||||
#include "generic-link-service.hpp"
|
#include "generic-link-service.hpp"
|
||||||
#include "multicast-ethernet-transport.hpp"
|
#include "multicast-ethernet-transport.hpp"
|
||||||
|
#include "pcap-helper.hpp"
|
||||||
|
|
||||||
#include <boost/range/adaptors.hpp>
|
#include <boost/range/adaptors.hpp>
|
||||||
#include <boost/range/algorithm/copy.hpp>
|
#include <boost/range/algorithm/copy.hpp>
|
||||||
@@ -337,6 +338,10 @@ EthernetFactory::applyMcastConfigToNetif(const ndn::net::NetworkInterface& netif
|
|||||||
NFD_LOG_WARN("Cannot create multicast face on " << netif.getName() << ": " << e.what());
|
NFD_LOG_WARN("Cannot create multicast face on " << netif.getName() << ": " << e.what());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
catch (const PcapHelper::Error& e) {
|
||||||
|
NFD_LOG_WARN("Cannot create multicast face on " << netif.getName() << ": " << e.what());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (face->getId() == INVALID_FACEID) {
|
if (face->getId() == INVALID_FACEID) {
|
||||||
// new face: register with forwarding
|
// new face: register with forwarding
|
||||||
|
|||||||
Reference in new issue
Block a user