summaryrefslogtreecommitdiff
path: root/testnet/TestEthernetTapFactory.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-24 17:29:09 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-24 17:29:09 -0700
commit8672ca9cf8b7f065c8e9faa134e5af0683e9f416 (patch)
tree0da537144bb71f6a272ad5bbd1b4685b8410e110 /testnet/TestEthernetTapFactory.cpp
parenta75a7547b4ea104208e222e521f44471ba7669e5 (diff)
downloadinfinitytier-8672ca9cf8b7f065c8e9faa134e5af0683e9f416.tar.gz
infinitytier-8672ca9cf8b7f065c8e9faa134e5af0683e9f416.zip
Prep for real tests like alltoall.
Diffstat (limited to 'testnet/TestEthernetTapFactory.cpp')
-rw-r--r--testnet/TestEthernetTapFactory.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/testnet/TestEthernetTapFactory.cpp b/testnet/TestEthernetTapFactory.cpp
index 836f586e..1e72bc4e 100644
--- a/testnet/TestEthernetTapFactory.cpp
+++ b/testnet/TestEthernetTapFactory.cpp
@@ -57,6 +57,10 @@ EthernetTap *TestEthernetTapFactory::open(
Mutex::Lock _l(_tapsByMac_m);
_tapsByMac[mac] = tap;
}
+ {
+ Mutex::Lock _l(_tapsByNwid_m);
+ _tapsByNwid[nwid] = tap;
+ }
return tap.ptr();
}
@@ -73,6 +77,10 @@ void TestEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevice
Mutex::Lock _l(_tapsByMac_m);
_tapsByMac.erase(tapp->mac());
}
+ {
+ Mutex::Lock _l(_tapsByNwid_m);
+ _tapsByNwid.erase(tapp->nwid());
+ }
}
} // namespace ZeroTier