summaryrefslogtreecommitdiff
path: root/include/login_routes.hpp
diff options
context:
space:
mode:
authorJiaqing Zhao <jiaqing.zhao@intel.com>2021-12-07 08:21:47 +0300
committerEd Tanous <ed@tanous.net>2021-12-10 04:16:55 +0300
commit41d61c8281ed9af50630c78f0a646e726139fb25 (patch)
tree2b904f845bd1d086fccd54014cb2b5e058acc175 /include/login_routes.hpp
parent2558979c8b57a25ed8a4e676d3bf2a762d749056 (diff)
downloadbmcweb-41d61c8281ed9af50630c78f0a646e726139fb25.tar.xz
Convert IPv4-mapped IPv6 ClientIP back to IPv4
Current HTTP server creates an IPv6 acceptor to accept both IPv4 and IPv6 connections. In this way, IPv4 address will be presented as IPv6 address in IPv4-mapped format. This patch converts it back to IPv4. Tested: Verified the ClientOriginIP in Session is shown in native IPv4 format instead of IPv4-mapped IPv6 format. Change-Id: Icd51260b2d4572d52f5c670128b7f07f6b5e6912 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
Diffstat (limited to 'include/login_routes.hpp')
-rw-r--r--include/login_routes.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/login_routes.hpp b/include/login_routes.hpp
index 42eebfe1db..881035619a 100644
--- a/include/login_routes.hpp
+++ b/include/login_routes.hpp
@@ -143,8 +143,7 @@ inline void requestRoutes(App& app)
auto session =
persistent_data::SessionStore::getInstance()
.generateUserSession(
- username, req.ipAddress.to_string(),
- unsupportedClientId,
+ username, req.ipAddress, unsupportedClientId,
persistent_data::PersistenceType::TIMEOUT,
isConfigureSelfOnly);