softether-5/patches/simplify_l2tp_auth.patch

60 lines
3.2 KiB
Diff

diff --git a/src/Cedar/Proto_PPP.c b/src/Cedar/Proto_PPP.c
index e9908e0..120a65b 100644
--- a/src/Cedar/Proto_PPP.c
+++ b/src/Cedar/Proto_PPP.c
@@ -320,12 +320,12 @@ void PPPThread(THREAD *thread, void *param)
if (p->PPPStatus == PPP_STATUS_CONNECTED && authReqSent == false)
{
- // EAP code
+ // PAP code
PPP_LCP *c = NewPPPLCP(PPP_LCP_CODE_REQ, 0);
- USHORT eap_code = Endian16(PPP_LCP_AUTH_EAP);
+ USHORT pap_code = Endian16(PPP_LCP_AUTH_PAP);
- Debug("Request EAP\n");
- Add(c->OptionList, NewPPPOption(PPP_LCP_OPTION_AUTH, &eap_code, sizeof(eap_code)));
+ Debug("Request PAP\n");
+ Add(c->OptionList, NewPPPOption(PPP_LCP_OPTION_AUTH, &pap_code, sizeof(pap_code)));
if (PPPSendAndRetransmitRequest(p, PPP_PROTOCOL_LCP, c) == false)
{
PPPSetStatus(p, PPP_STATUS_FAIL);
@@ -1871,12 +1871,6 @@ bool PPPProcessPAPRequestPacket(PPP_SESSION *p, PPP_PACKET *pp)
p->AuthOk = true;
}
- else
- {
- PPPSetStatus(p, PPP_STATUS_FAIL);
- WHERE;
- return false;
- }
}
}
}
diff --git a/src/Cedar/Proto_PPP.h b/src/Cedar/Proto_PPP.h
index 1278fbc..20500cc 100644
--- a/src/Cedar/Proto_PPP.h
+++ b/src/Cedar/Proto_PPP.h
@@ -32,18 +32,18 @@
#define PPP_CODE_IS_REQUEST(protocol, c) ((((protocol) == PPP_PROTOCOL_LCP || (protocol) == PPP_PROTOCOL_IPCP || (protocol) == PPP_PROTOCOL_IPV6CP) && PPP_LCP_CODE_IS_REQUEST(c)) || (((protocol) == PPP_PROTOCOL_PAP) && PPP_PAP_CODE_IS_REQUEST(c)) || (((protocol) == PPP_PROTOCOL_CHAP) && PPP_CHAP_CODE_IS_REQUEST(c)) || (((protocol) == PPP_PROTOCOL_EAP) && PPP_EAP_CODE_IS_REQUEST(c)))
#define PPP_CODE_IS_WITH_OPTION_LIST(protocol, c) ((((protocol) == PPP_PROTOCOL_LCP || (protocol) == PPP_PROTOCOL_IPCP || (protocol) == PPP_PROTOCOL_IPV6CP) && PPP_LCP_CODE_IS_WITH_OPTION_LIST(c)) || false)
-#define PPP_IS_SUPPORTED_PROTOCOL(p) ((p) == PPP_PROTOCOL_LCP || (p) == PPP_PROTOCOL_PAP || (p) == PPP_PROTOCOL_CHAP || (p) == PPP_PROTOCOL_IPCP || (p) == PPP_PROTOCOL_IPV6CP || (p) == PPP_PROTOCOL_IP || (p) == PPP_PROTOCOL_IPV6 || (p) == PPP_PROTOCOL_EAP )
+#define PPP_IS_SUPPORTED_PROTOCOL(p) ((p) == PPP_PROTOCOL_LCP || (p) == PPP_PROTOCOL_PAP || (p) == PPP_PROTOCOL_IPCP || (p) == PPP_PROTOCOL_IP)
#define PPP_STATUS_IS_UNAVAILABLE(c) ((c) == PPP_STATUS_FAIL || (c) == PPP_STATUS_AUTH_FAIL || (c) == PPP_STATUS_CLOSING || (c) == PPP_STATUS_CLOSING_WAIT || (c) == PPP_STATUS_CLOSED)
//// Constants
// Time-out value
-#define PPP_PACKET_RECV_TIMEOUT (15 * 1000) // Timeout until the next packet is received (3/4 of default policy)
+#define PPP_PACKET_RECV_TIMEOUT (90 * 1000) // Timeout until the next packet is received (3/4 of default policy)
#define PPP_PACKET_RESEND_INTERVAL (3 * 1000) // Retransmission interval of the last packet
#define PPP_TERMINATE_TIMEOUT 2000 // Timeout value to complete disconnection after requesting to disconnect in the PPP
#define PPP_ECHO_SEND_INTERVAL 4792 // Transmission interval of PPP Echo Request
-#define PPP_DATA_TIMEOUT (20 * 1000) // Communication time-out (from default policy)
+#define PPP_DATA_TIMEOUT (120 * 1000) // Communication time-out (from default policy)
// MRU
#define PPP_MRU_DEFAULT 1500 // Default value