mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 16:25:01 +03:00
Fix use-after-free timeout issue for L2TP and SSTP
This commit is contained in:
@ -2008,7 +2008,6 @@ UINT CalcL2TPMss(L2TP_SERVER *l2tp, L2TP_TUNNEL *t, L2TP_SESSION *s)
|
||||
// Start the L2TP thread
|
||||
void StartL2TPThread(L2TP_SERVER *l2tp, L2TP_TUNNEL *t, L2TP_SESSION *s)
|
||||
{
|
||||
PPP_SESSION* underlyingSession;
|
||||
// Validate arguments
|
||||
if (l2tp == NULL || t == NULL || s == NULL)
|
||||
{
|
||||
@ -2037,11 +2036,9 @@ void StartL2TPThread(L2TP_SERVER *l2tp, L2TP_TUNNEL *t, L2TP_SESSION *s)
|
||||
}
|
||||
|
||||
// Create a PPP thread
|
||||
underlyingSession = NewPPPSession(l2tp->Cedar, &t->ClientIp, t->ClientPort, &t->ServerIp, t->ServerPort,
|
||||
s->Thread = NewPPPSession(l2tp->Cedar, &t->ClientIp, t->ClientPort, &t->ServerIp, t->ServerPort,
|
||||
s->TubeSend, s->TubeRecv, L2TP_IPC_POSTFIX, tmp, t->HostName, l2tp->CryptName,
|
||||
CalcL2TPMss(l2tp, t, s));
|
||||
s->Thread = underlyingSession->SessionThread;
|
||||
s->PPPSession = underlyingSession;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2145,9 +2142,9 @@ void L2TPProcessInterrupts(L2TP_SERVER *l2tp)
|
||||
{
|
||||
L2TP_SESSION* s = LIST_DATA(t->SessionList, i);
|
||||
|
||||
if (s->PPPSession != NULL && s->PPPSession->DataTimeout > l2tpTimeout)
|
||||
if (s->TubeRecv != NULL && s->TubeRecv->DataTimeout > l2tpTimeout)
|
||||
{
|
||||
l2tpTimeout = s->PPPSession->DataTimeout;
|
||||
l2tpTimeout = s->TubeRecv->DataTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user