Commit cd29ec48 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

sockets: Use socket family in show_inetsk

Needed for IPv6.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 702ab17e
...@@ -1160,13 +1160,13 @@ void show_inetsk(int fd, struct cr_options *o) ...@@ -1160,13 +1160,13 @@ void show_inetsk(int fd, struct cr_options *o)
if (ret <= 0) if (ret <= 0)
goto out; goto out;
if (inet_ntop(AF_INET, (void *)ie.src_addr, src_addr, if (inet_ntop(ie.family, (void *)ie.src_addr, src_addr,
INET_ADDR_LEN) == NULL) { INET_ADDR_LEN) == NULL) {
pr_perror("Failed to translate src address"); pr_perror("Failed to translate src address");
} }
if (ie.state == TCP_ESTABLISHED) { if (ie.state == TCP_ESTABLISHED) {
if (inet_ntop(AF_INET, (void *)ie.dst_addr, dst_addr, if (inet_ntop(ie.family, (void *)ie.dst_addr, dst_addr,
INET_ADDR_LEN) == NULL) { INET_ADDR_LEN) == NULL) {
pr_perror("Failed to translate dst address"); pr_perror("Failed to translate dst address");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment