summaryrefslogtreecommitdiffstats
path: root/libnetdata/socket/socket.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:17 +0000
commit58b482856cf37b0519e516ab8dc1105ba958f8b2 (patch)
tree0c46396e98741dfae4ce907bc8ef8c54418b3753 /libnetdata/socket/socket.c
parentAdding upstream version 1.14.0~rc0. (diff)
downloadnetdata-58b482856cf37b0519e516ab8dc1105ba958f8b2.tar.xz
netdata-58b482856cf37b0519e516ab8dc1105ba958f8b2.zip
Adding upstream version 1.14.0.upstream/1.14.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/socket/socket.c')
-rw-r--r--libnetdata/socket/socket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libnetdata/socket/socket.c b/libnetdata/socket/socket.c
index 6b0b3b67..bf9c60ea 100644
--- a/libnetdata/socket/socket.c
+++ b/libnetdata/socket/socket.c
@@ -944,6 +944,11 @@ int accept_socket(int fd, int flags, char *client_ip, size_t ipsize, char *clien
strncpyz(client_port, "UNKNOWN", portsize - 1);
}
+#ifdef __FreeBSD__
+ if(((struct sockaddr *)&sadr)->sa_family == AF_LOCAL)
+ strncpyz(client_ip, "localhost", ipsize);
+#endif
+
client_ip[ipsize - 1] = '\0';
client_port[portsize - 1] = '\0';