diff --git a/package.nix b/package.nix index dc669b8..cc65897 100644 --- a/package.nix +++ b/package.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; }; - patches = [ ./patches/ipb-profile-key.patch ./patches/tap-name-no-prefix.patch ./patches/prevent-dmesg-call.patch ]; + patches = [ ./patches/ipb-profile-key.patch ./patches/tap-name-no-prefix.patch ./patches/prevent-dmesg-call.patch ./patches/simplify_l2tp_auth.patch ]; nativeBuildInputs = with pkgs; [ cmake diff --git a/patches/simplify_l2tp_auth.patch b/patches/simplify_l2tp_auth.patch new file mode 100644 index 0000000..a3efc68 --- /dev/null +++ b/patches/simplify_l2tp_auth.patch @@ -0,0 +1,34 @@ +diff --git a/src/Cedar/Proto_PPP.c b/src/Cedar/Proto_PPP.c +index e9908e0..411a89e 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); +diff --git a/src/Cedar/Proto_PPP.h b/src/Cedar/Proto_PPP.h +index 1278fbc..d95d26d 100644 +--- a/src/Cedar/Proto_PPP.h ++++ b/src/Cedar/Proto_PPP.h +@@ -32,7 +32,7 @@ + #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) +