This commit is contained in:
2025-12-02 17:11:03 +01:00
parent 210f9f2436
commit 3bda0b2ec4
2 changed files with 3 additions and 4 deletions

View File

@@ -134,9 +134,9 @@ namespace ColumnLynx::Net {
std::unique_lock lock(mMutex); std::unique_lock lock(mMutex);
mSessionIPs[sessionID] = ip; mSessionIPs[sessionID] = ip;
if (mIPSessions.find(sessionID) == mIPSessions.end()) { /*if (mIPSessions.find(sessionID) == mIPSessions.end()) {
Utils::debug("yikes"); Utils::debug("yikes");
} }*/
mIPSessions[ip] = mSessions.find(sessionID)->second; mIPSessions[ip] = mSessions.find(sessionID)->second;
} }

View File

@@ -229,8 +229,6 @@ namespace ColumnLynx::Net::TCP {
tunConfig.clientIP = htonl(clientIP); // e.g. 10.10.0.X tunConfig.clientIP = htonl(clientIP); // e.g. 10.10.0.X
tunConfig.dns1 = htonl(0x08080808); // 8.8.8.8 tunConfig.dns1 = htonl(0x08080808); // 8.8.8.8
tunConfig.dns2 = 0; tunConfig.dns2 = 0;
SessionRegistry::getInstance().lockIP(mConnectionSessionID, clientIP);
uint64_t sessionIDNet = Utils::chtobe64(mConnectionSessionID); uint64_t sessionIDNet = Utils::chtobe64(mConnectionSessionID);
@@ -249,6 +247,7 @@ namespace ColumnLynx::Net::TCP {
Utils::log("Handshake with " + reqAddr + " completed successfully. Session ID assigned (" + std::to_string(mConnectionSessionID) + ")."); Utils::log("Handshake with " + reqAddr + " completed successfully. Session ID assigned (" + std::to_string(mConnectionSessionID) + ").");
auto session = std::make_shared<SessionState>(mConnectionAESKey, std::chrono::hours(12), clientIP, htonl(0x0A0A0001), mConnectionSessionID); auto session = std::make_shared<SessionState>(mConnectionAESKey, std::chrono::hours(12), clientIP, htonl(0x0A0A0001), mConnectionSessionID);
SessionRegistry::getInstance().put(mConnectionSessionID, std::move(session)); SessionRegistry::getInstance().put(mConnectionSessionID, std::move(session));
SessionRegistry::getInstance().lockIP(mConnectionSessionID, clientIP);
} catch (const std::exception& e) { } catch (const std::exception& e) {
Utils::error("Failed to decrypt HANDSHAKE_EXCHANGE_KEY from " + reqAddr + ": " + e.what()); Utils::error("Failed to decrypt HANDSHAKE_EXCHANGE_KEY from " + reqAddr + ": " + e.what());