[xiph-commits] r14319 - icecast/trunk/net

karl at svn.xiph.org karl at svn.xiph.org
Thu Dec 20 08:49:03 PST 2007


Author: karl
Date: 2007-12-20 08:49:02 -0800 (Thu, 20 Dec 2007)
New Revision: 14319

Modified:
   icecast/trunk/net/sock.c
Log:
drop const usage and work around a FBSD issue with listening sockets


Modified: icecast/trunk/net/sock.c
===================================================================
--- icecast/trunk/net/sock.c	2007-12-20 16:36:37 UTC (rev 14318)
+++ icecast/trunk/net/sock.c	2007-12-20 16:49:02 UTC (rev 14319)
@@ -548,7 +548,7 @@
 
 #ifdef HAVE_GETADDRINFO
 
-sock_t sock_connect_non_blocking (const char *hostname, const unsigned port)
+sock_t sock_connect_non_blocking (const char *hostname, unsigned port)
 {
     int sock = SOCK_ERROR;
     struct addrinfo *ai, *head, hints;
@@ -674,6 +674,8 @@
             continue;
 
         setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, sizeof(on));
+        on = 0;
+        setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof on);
 
         if (bind (sock, ai->ai_addr, ai->ai_addrlen) < 0)
         {
@@ -693,7 +695,7 @@
 #else
 
 
-int sock_try_connection (sock_t sock, const char *hostname, const unsigned port)
+int sock_try_connection (sock_t sock, const char *hostname, unsigned int port)
 {
     struct sockaddr_in sin, server;
     char ip[MAX_ADDR_LEN];



More information about the commits mailing list