[CRIU] [PATCH 2/7] sockets: Use socket family for inet_ntop

Cyrill Gorcunov gorcunov at openvz.org
Fri Apr 20 18:56:35 EDT 2012


Will need it for IPv6

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 sockets.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sockets.c b/sockets.c
index e387f1a..5b3b13a 100644
--- a/sockets.c
+++ b/sockets.c
@@ -122,7 +122,7 @@ static void show_one_inet(const char *act, const struct inet_sk_desc *sk)
 {
 	char src_addr[INET_ADDR_LEN] = "<unknown>";
 
-	if (inet_ntop(AF_INET, (void *)sk->src_addr, src_addr,
+	if (inet_ntop(sk->sd.family, (void *)sk->src_addr, src_addr,
 		      INET_ADDR_LEN) == NULL) {
 		pr_perror("Failed to translate address");
 	}
@@ -137,7 +137,7 @@ static void show_one_inet_img(const char *act, const struct inet_sk_entry *e)
 {
 	char src_addr[INET_ADDR_LEN] = "<unknown>";
 
-	if (inet_ntop(AF_INET, (void *)e->src_addr, src_addr,
+	if (inet_ntop(e->family, (void *)e->src_addr, src_addr,
 		      INET_ADDR_LEN) == NULL) {
 		pr_perror("Failed to translate address");
 	}
-- 
1.7.7.6



More information about the CRIU mailing list