diff options
| author | Jeremie Le Hen <jlh@FreeBSD.org> | 2019-10-09 20:01:23 +0000 |
|---|---|---|
| committer | Jeremie Le Hen <jlh@FreeBSD.org> | 2019-10-09 20:01:23 +0000 |
| commit | b9eabd15fd31699f2da788da6f8601d2d9b534da (patch) | |
| tree | 40e5e32928c3d535352f2b4ea95bcb598c588e44 /usr.bin/procstat | |
| parent | a930ecddaa16ab5470cb50b1d8b359ea30b4dd60 (diff) | |
Notes
Diffstat (limited to 'usr.bin/procstat')
| -rw-r--r-- | usr.bin/procstat/procstat_files.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c index 7a55659abcb5b..700f6438fe4ba 100644 --- a/usr.bin/procstat/procstat_files.c +++ b/usr.bin/procstat/procstat_files.c @@ -106,8 +106,13 @@ addr_to_string(struct sockaddr_storage *ss, char *buffer, int buflen) case AF_INET: sin = (struct sockaddr_in *)ss; - snprintf(buffer, buflen, "%s:%d", inet_ntoa(sin->sin_addr), - ntohs(sin->sin_port)); + if (IS_INADDR_ANY(sin->sin_addr)) + snprintf(buffer, buflen, "%s:%d", "*", + ntohs(sin->sin_port)); + else if (inet_ntop(AF_INET, &sin->sin_addr, buffer2, + sizeof(buffer2)) != NULL) + snprintf(buffer, buflen, "%s:%d", buffer2, + ntohs(sin->sin_port)); break; case AF_INET6: |
