fix(socket): restore logging of local ip and port
commit a92b413 removed the logging of local ip and port.
For debugging puposes these information can be important.
Restore functionality by using the new thread safe replacement
for inet_ntoa called inet_ntop.
Signed-off-by: Peter Lieven <pl@dlhnet.de>
This commit is contained in:
@@ -1073,7 +1073,10 @@ iscsi_tcp_service(struct iscsi_context *iscsi, int revents)
|
||||
}
|
||||
|
||||
if (getsockname(iscsi->fd, (struct sockaddr *) &local, &local_l) == 0) {
|
||||
ISCSI_LOG(iscsi, 2, "connection established to %s", iscsi->connected_portal);
|
||||
char ip[INET_ADDRSTRLEN];
|
||||
inet_ntop(AF_INET, &local.sin_addr, ip, sizeof(ip));
|
||||
ISCSI_LOG(iscsi, 2, "connection established (%s:%u -> %s)", ip,
|
||||
(unsigned)ntohs(local.sin_port), iscsi->connected_portal);
|
||||
}
|
||||
|
||||
iscsi->is_connected = 1;
|
||||
|
||||
Reference in New Issue
Block a user