]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
dccp_send: set IP_MULTICAST_LOOP for the ortp socket
authorAndre <maan@p133.(none)>
Fri, 7 Jul 2006 13:35:31 +0000 (15:35 +0200)
committerAndre <maan@p133.(none)>
Fri, 7 Jul 2006 13:35:31 +0000 (15:35 +0200)
This fixes sending to localhost.

ortp_send.c

index dd4ee88409c3155853150c62736c6fa40ee4573c..b084bb68ac4b89b3a3921c5d002d00444ba14cb3 100644 (file)
@@ -87,6 +87,20 @@ static void ortp_send_buf(char *buf, int len, long unsigned chunks_sent)
        }
 }
 
        }
 }
 
+static int set_multicast(RtpSession *s)
+{
+       unsigned char loop = 1;
+       int ret;
+
+       ret = setsockopt(s->rtp.socket,
+               IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop));
+       if (ret < 0) {
+               PARA_ERROR_LOG("IP_MULTICAST_LOOP error %d\n", ret);
+
+       }
+       return 1;
+}
+
 static void ortp_init_session(struct ortp_target *ot)
 {
        RtpSession *s;
 static void ortp_init_session(struct ortp_target *ot)
 {
        RtpSession *s;
@@ -108,7 +122,9 @@ static void ortp_init_session(struct ortp_target *ot)
        if (ret < 0) {
                rtp_session_destroy(ot->session);
                ot->session = NULL;
        if (ret < 0) {
                rtp_session_destroy(ot->session);
                ot->session = NULL;
+               return;
        }
        }
+       set_multicast(s);
 }
 
 /* called by afs */
 }
 
 /* called by afs */