Commit 2bfd92b3 authored by Martin Storsjö's avatar Martin Storsjö

udp: Set ttl for read-write streams, too, not only for write-only ones

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent c700fdb0
...@@ -400,11 +400,12 @@ static int udp_open(URLContext *h, const char *uri, int flags) ...@@ -400,11 +400,12 @@ static int udp_open(URLContext *h, const char *uri, int flags)
s->local_port = udp_port(&my_addr, len); s->local_port = udp_port(&my_addr, len);
if (s->is_multicast) { if (s->is_multicast) {
if (!(h->flags & AVIO_FLAG_READ)) { if (h->flags & AVIO_FLAG_WRITE) {
/* output */ /* output */
if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0) if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0)
goto fail; goto fail;
} else { }
if (h->flags & AVIO_FLAG_READ) {
/* input */ /* input */
if (udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0) if (udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0)
goto fail; goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment