diff options
author | Jiaqing Zhao <jiaqing.zhao@intel.com> | 2021-12-07 08:21:47 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-12-10 04:16:55 +0300 |
commit | 41d61c8281ed9af50630c78f0a646e726139fb25 (patch) | |
tree | 2b904f845bd1d086fccd54014cb2b5e058acc175 /redfish-core/lib/redfish_sessions.hpp | |
parent | 2558979c8b57a25ed8a4e676d3bf2a762d749056 (diff) | |
download | bmcweb-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 'redfish-core/lib/redfish_sessions.hpp')
-rw-r--r-- | redfish-core/lib/redfish_sessions.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp index 929e0c8cb7..234a52476e 100644 --- a/redfish-core/lib/redfish_sessions.hpp +++ b/redfish-core/lib/redfish_sessions.hpp @@ -201,7 +201,7 @@ inline void requestRoutesSession(App& app) std::shared_ptr<persistent_data::UserSession> session = persistent_data::SessionStore::getInstance() .generateUserSession( - username, req.ipAddress.to_string(), clientId, + username, req.ipAddress, clientId, persistent_data::PersistenceType::TIMEOUT, isConfigureSelfOnly); asyncResp->res.addHeader("X-Auth-Token", session->sessionToken); |