tcp_received() fix

This commit is contained in:
Joseph Henry
2017-09-07 18:09:19 -07:00
parent e18c1ccf80
commit 4fd2db7dd6
10 changed files with 223 additions and 124 deletions

View File

@@ -550,18 +550,24 @@ namespace ZeroTier {
return err;
}
// Remove VritualSocket from VirtualTap, and instruct network stacks to dismantle their
// respective protocol control structures
int VirtualTap::Close(VirtualSocket *vs) {
int err = 0;
if(!vs) {
DEBUG_ERROR("invalid VirtualSocket");
return -1;
}
removeVirtualSocket(vs);
#if defined(STACK_PICO)
err = picostack->pico_Close(vs);
if(picostack) {
err = picostack->pico_Close(vs);
}
#endif
#if defined(STACK_LWIP)
if(lwipstack)
lwipstack->lwip_Close(vs);
if(lwipstack) {
err = lwipstack->lwip_Close(vs);
}
#endif
if(vs->sock) {
_phy.close(vs->sock, false);