[socket] Fix getpeername() returning local address instead of remote in LWIP raw TCP (#12475)

This commit is contained in:
J. Nick Koston
2025-12-16 00:48:30 -06:00
committed by GitHub
parent 7fe8e53f82
commit ead60bc5c4

View File

@@ -188,7 +188,7 @@ class LWIPRawImpl : public Socket {
errno = EINVAL;
return -1;
}
return this->ip2sockaddr_(&pcb_->local_ip, pcb_->local_port, name, addrlen);
return this->ip2sockaddr_(&pcb_->remote_ip, pcb_->remote_port, name, addrlen);
}
std::string getpeername() override {
if (pcb_ == nullptr) {