From f3ce15a8bc3c0d64008e014b9147ddbd76f47a2d Mon Sep 17 00:00:00 2001 From: Andre Date: Fri, 7 Jul 2006 15:35:31 +0200 Subject: [PATCH 1/1] dccp_send: set IP_MULTICAST_LOOP for the ortp socket This fixes sending to localhost. --- ortp_send.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ortp_send.c b/ortp_send.c index dd4ee884..b084bb68 100644 --- a/ortp_send.c +++ b/ortp_send.c @@ -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; @@ -108,7 +122,9 @@ static void ortp_init_session(struct ortp_target *ot) if (ret < 0) { rtp_session_destroy(ot->session); ot->session = NULL; + return; } + set_multicast(s); } /* called by afs */ -- 2.30.2