[MPlayer-cvslog] r31498 - trunk/stream/tcp.c

attila subversion at mplayerhq.hu
Sun Jun 20 21:29:18 CEST 2010


Author: attila
Date: Sun Jun 20 21:29:18 2010
New Revision: 31498

Log:
Prefere the use of inet_ntop over inet_ntoa, as the former is ipv6 safe.
This fixes bug #1491

Modified:
   trunk/stream/tcp.c

Modified: trunk/stream/tcp.c
==============================================================================
--- trunk/stream/tcp.c	Sun Jun 20 21:26:57 2010	(r31497)
+++ trunk/stream/tcp.c	Sun Jun 20 21:29:18 2010	(r31498)
@@ -187,10 +187,10 @@ connect2Server_with_af(char *host, int p
 			return TCP_ERROR_FATAL;
 	}
 
-#if HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
-	av_strlcpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
-#else
+#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);
 #endif
 	if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ConnectingToServer, host, buf , port );
 


More information about the MPlayer-cvslog mailing list