mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-30 19:40:47 -07:00
Fixed recursive lock problem in closeConnection
This commit is contained in:
parent
b263926ea6
commit
c25ceaf06b
2 changed files with 15 additions and 9 deletions
|
@ -292,14 +292,14 @@ void NetconEthernetTap::closeAllClients()
|
|||
void NetconEthernetTap::closeConnection(NetconConnection *conn)
|
||||
{
|
||||
NetconClient *client = conn->owner;
|
||||
lwipstack->tcp_arg(conn->pcb, NULL);
|
||||
lwipstack->tcp_sent(conn->pcb, NULL);
|
||||
lwipstack->tcp_recv(conn->pcb, NULL);
|
||||
lwipstack->tcp_err(conn->pcb, NULL);
|
||||
lwipstack->tcp_poll(conn->pcb, NULL, 0);
|
||||
lwipstack->tcp_close(conn->pcb);
|
||||
lwipstack->_tcp_arg(conn->pcb, NULL);
|
||||
lwipstack->_tcp_sent(conn->pcb, NULL);
|
||||
lwipstack->_tcp_recv(conn->pcb, NULL);
|
||||
lwipstack->_tcp_err(conn->pcb, NULL);
|
||||
lwipstack->_tcp_poll(conn->pcb, NULL, 0);
|
||||
lwipstack->_tcp_close(conn->pcb);
|
||||
_phy.close(conn->sock);
|
||||
lwipstack->tcp_close(conn->pcb);
|
||||
lwipstack->_tcp_close(conn->pcb);
|
||||
client->removeConnection(conn->sock);
|
||||
}
|
||||
|
||||
|
@ -308,8 +308,11 @@ void NetconEthernetTap::closeConnection(NetconConnection *conn)
|
|||
*/
|
||||
void NetconEthernetTap::closeClient(NetconClient *client)
|
||||
{
|
||||
closeConnection(client->rpc);
|
||||
closeConnection(client->unmapped_conn);
|
||||
{
|
||||
Mutex::Lock _l(lwipstack->_lock);
|
||||
closeConnection(client->rpc);
|
||||
closeConnection(client->unmapped_conn);
|
||||
}
|
||||
for(size_t i=0; i<client->connections.size(); i++)
|
||||
{
|
||||
close(_phy.getDescriptor(client->connections[i]->sock));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue