wider selftest coverage

This commit is contained in:
Joseph Henry
2017-05-05 16:46:07 -07:00
parent d631e06d99
commit dcdc13204c
31 changed files with 1613 additions and 303 deletions

View File

@@ -75,7 +75,7 @@ namespace ZeroTier {
_unixListenSocket((PhySocket *)0),
_phy(this,false,true)
{
_thread = Thread::start(this);
_thread = Thread::start(this);
}
SocketTap::~SocketTap()
@@ -98,7 +98,7 @@ namespace ZeroTier {
return _enabled;
}
bool SocketTap::addIp(const InetAddress &ip)
bool SocketTap::registerIpWithStack(const InetAddress &ip)
{
if(picostack) {
if(ip.isV4())
@@ -123,6 +123,17 @@ namespace ZeroTier {
return false;
}
bool SocketTap::addIp(const InetAddress &ip)
{
if(registerIpWithStack(ip))
{
// only start the stack if we successfully registered and initialized a device to
// the given address
return true;
}
return false;
}
bool SocketTap::removeIp(const InetAddress &ip)
{
DEBUG_INFO();
@@ -269,11 +280,11 @@ namespace ZeroTier {
DEBUG_ERROR("invalid connection");
return;
}
picostack->pico_Close(conn);
if(!conn->sock) {
DEBUG_EXTRA("invalid PhySocket");
return;
}
picostack->pico_Close(conn);
// Here we assume _tcpconns_m is already locked by caller
// FIXME: is this assumption still valid
if(conn->sock)