diff options
Diffstat (limited to 'src/core/socket.c')
-rw-r--r-- | src/core/socket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 0d96f1a933..af39553001 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -858,14 +858,12 @@ static int instance_from_socket(int fd, unsigned nr, char **instance) { be16toh(remote.in6.sin6_port)) < 0) return -ENOMEM; } else { - char a[INET6_ADDRSTRLEN], b[INET6_ADDRSTRLEN]; - if (asprintf(&r, "%u-%s:%u-%s:%u", nr, - inet_ntop(AF_INET6, &local.in6.sin6_addr, a, sizeof(a)), + IN6_ADDR_TO_STRING(&local.in6.sin6_addr), be16toh(local.in6.sin6_port), - inet_ntop(AF_INET6, &remote.in6.sin6_addr, b, sizeof(b)), + IN6_ADDR_TO_STRING(&remote.in6.sin6_addr), be16toh(remote.in6.sin6_port)) < 0) return -ENOMEM; } |