Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sim_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ if (connectaddr != NULL) {
p_getnameinfo((struct sockaddr *)&clientname, size, *connectaddr, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
if (0 == memcmp("::ffff:", *connectaddr, 7)) /* is this a IPv4-mapped IPv6 address? */
memmove(*connectaddr, 7+*connectaddr, /* prefer bare IPv4 address */
strlen(*connectaddr) - 7 + 1); /* length to include terminating \0 */
strlen(7+*connectaddr) + 1); /* length to include terminating \0 */
}

if (!(opt_flags & SIM_SOCK_OPT_BLOCKING)) {
Expand Down Expand Up @@ -1321,7 +1321,7 @@ int ret = 0;
ret = p_getnameinfo(addr, size, hostnamebuf, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
if (0 == memcmp("::ffff:", hostnamebuf, 7)) /* is this a IPv4-mapped IPv6 address? */
memmove(hostnamebuf, 7+hostnamebuf, /* prefer bare IPv4 address */
strlen(hostnamebuf) + 7 - 1); /* length to include terminating \0 */
strlen(7+hostnamebuf) + 1); /* length to include terminating \0 */
if (!ret)
ret = p_getnameinfo(addr, size, NULL, 0, portnamebuf, NI_MAXSERV, NI_NUMERICSERV);
return ret;
Expand Down
Loading