Browse code

- multicast fix for bsd - removed some extra_debug info (too verbose)

Andrei Pelinescu-Onciul authored on 06/07/2005 16:10:05
Showing 2 changed files
... ...
@@ -736,11 +736,6 @@ inline static int io_wait_loop_kqueue(io_wait_h* h, int t, int repeat)
736 736
 again:
737 737
 		n=kevent(h->kq_fd, h->kq_changes, h->kq_nchanges,  h->kq_array,
738 738
 					h->fd_no, &tspec);
739
-#ifdef EXTRA_DEBUG
740
-		DBG("DBG: kevent(%d, %p, %d, %p, %d, ...)=%d\n",
741
-			 h->kq_fd, h->kq_changes, h->kq_nchanges,  h->kq_array, h->fd_no,
742
-			 n);
743
-#endif
744 739
 		if (n==-1){
745 740
 			if (errno==EINTR) goto again; /* signal, ignore it */
746 741
 			else{
... ...
@@ -268,6 +268,9 @@ int udp_init(struct socket_info* sock_info)
268 268
 {
269 269
 	union sockaddr_union* addr;
270 270
 	int optval;
271
+#ifdef USE_MCAST
272
+	unsigned char m_ttl, m_loop;
273
+#endif
271 274
 	addr=&sock_info->su;
272 275
 /*
273 276
 	addr=(union sockaddr_union*)pkg_malloc(sizeof(union sockaddr_union));
... ...
@@ -318,16 +321,18 @@ int udp_init(struct socket_info* sock_info)
318 318
 	}
319 319
 	/* set the multicast options */
320 320
 	if (addr->s.sa_family==AF_INET){
321
+		m_loop=mcast_loopback;
321 322
 		if (setsockopt(sock_info->socket, IPPROTO_IP, IP_MULTICAST_LOOP, 
322
-						&mcast_loopback, sizeof(mcast_loopback))==-1){
323
+						&m_loop, sizeof(m_loop))==-1){
323 324
 			LOG(L_WARN, "WARNING: udp_init: setsockopt(IP_MULTICAST_LOOP):"
324 325
 						" %s\n", strerror(errno));
325 326
 			/* it's only a warning because we might get this error if the
326 327
 			  network interface doesn't support multicasting -- andrei */
327 328
 		}
328 329
 		if (mcast_ttl>=0){
330
+			m_ttl=mcast_ttl;
329 331
 			if (setsockopt(sock_info->socket, IPPROTO_IP, IP_MULTICAST_TTL,
330
-						&mcast_ttl, sizeof(mcast_ttl))==-1){
332
+						&m_ttl, sizeof(m_ttl))==-1){
331 333
 				LOG(L_WARN, "WARNING: udp_init: setsockopt (IP_MULTICAST_TTL):"
332 334
 						" %s\n", strerror(errno));
333 335
 			}