- state_machine_manager: add deviceToRemotes reverse index (Map<deviceKeyJson, Set<remoteKey>>) so completeMachine/failMachine clean up remoteToDevice in O(1) — fixes unbounded memory leak - state_machine_manager: getHashIdForRemoteIp() now only matches RUNNING sessions and returns undefined when multiple candidates exist (NAT/CGNAT safety) - state_machine_manager: IPv6 bracket normalization in IP comparison - cwmp_controller: apply IP fallback to TransferComplete and generic response handler (same new-TCP-port scenario as empty POST after firmware reboot) - cwmp_logger_middleware: reuse request.cwmp.sessionId instead of recomputing from socket to avoid formula drift