... | ... |
@@ -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 | 321 |
} |
319 | 322 |
/* set the multicast options */ |
320 | 323 |
if (addr->s.sa_family==AF_INET){ |
324 |
+ m_loop=mcast_loopback; |
|
321 | 325 |
if (setsockopt(sock_info->socket, IPPROTO_IP, IP_MULTICAST_LOOP, |
322 |
- &mcast_loopback, sizeof(mcast_loopback))==-1){ |
|
326 |
+ &m_loop, sizeof(m_loop))==-1){ |
|
323 | 327 |
LOG(L_WARN, "WARNING: udp_init: setsockopt(IP_MULTICAST_LOOP):" |
324 | 328 |
" %s\n", strerror(errno)); |
325 | 329 |
/* it's only a warning because we might get this error if the |
326 | 330 |
network interface doesn't support multicasting -- andrei */ |
327 | 331 |
} |
328 | 332 |
if (mcast_ttl>=0){ |
333 |
+ m_ttl=mcast_ttl; |
|
329 | 334 |
if (setsockopt(sock_info->socket, IPPROTO_IP, IP_MULTICAST_TTL, |
330 |
- &mcast_ttl, sizeof(mcast_ttl))==-1){ |
|
335 |
+ &m_ttl, sizeof(m_ttl))==-1){ |
|
331 | 336 |
LOG(L_WARN, "WARNING: udp_init: setsockopt (IP_MULTICAST_TTL):" |
332 | 337 |
" %s\n", strerror(errno)); |
333 | 338 |
} |