changeset 31432:1bd903001629

Prefere the use of inet_ntop over inet_ntoa, as the former is ipv6 safe. This fixes bug #1491
author attila
date Sun, 20 Jun 2010 19:29:18 +0000
parents 29c120a9caad
children 045110c125c6
files stream/tcp.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tcp.c	Sun Jun 20 19:26:57 2010 +0000
+++ b/stream/tcp.c	Sun Jun 20 19:29:18 2010 +0000
@@ -187,10 +187,10 @@
 			return TCP_ERROR_FATAL;
 	}
 
-#if HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
+#if HAVE_INET_PTON
+	inet_ntop(af, our_s_addr, buf, 255);
+#elif HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
 	av_strlcpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
-#else
-	inet_ntop(af, our_s_addr, buf, 255);
 #endif
 	if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ConnectingToServer, host, buf , port );