From 1c295360fc537954de9cefb6a471eb8536fa530e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 22 Jan 2020 10:38:21 +0100 Subject: [PATCH] Double link inner-outer methods This allows inner methods to access method_defrag to get negotiated EAP-TTLS/PEAP protocol version. Signed-off-by: Simon Rozman --- lib/EAPBase/include/Method.h | 1 + lib/EAPBase/src/Method.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/EAPBase/include/Method.h b/lib/EAPBase/include/Method.h index 4712f35..fa8c8b7 100644 --- a/lib/EAPBase/include/Method.h +++ b/lib/EAPBase/include/Method.h @@ -192,6 +192,7 @@ namespace eap public: module &m_module; ///< Module for global services + method *m_outer; ///< Outer method }; diff --git a/lib/EAPBase/src/Method.cpp b/lib/EAPBase/src/Method.cpp index 7aa2ef1..4d5bed4 100644 --- a/lib/EAPBase/src/Method.cpp +++ b/lib/EAPBase/src/Method.cpp @@ -29,7 +29,8 @@ using namespace winstd; ////////////////////////////////////////////////////////////////////// eap::method::method(_In_ module &mod) : - m_module(mod) + m_module(mod), + m_outer(nullptr) { } @@ -107,6 +108,8 @@ eap::method_tunnel::method_tunnel(_In_ module &mod, _In_ method *inner) : m_inner(inner), method(mod) { + assert(m_inner); + m_inner->m_outer = this; }