diff stream/tcp.c @ 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 2fa6d8411b07
children 4f9bc9acf17e
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 );