[FFmpeg-devel] [PATCH] Make RTP work with IPv6 enabled
Luca Abeni
lucabe72
Tue Oct 30 08:53:50 CET 2007
Hi Nicolas,
Nicolas George wrote:
> L'octidi 8 brumaire, an CCXVI, Luca Abeni a ?crit :
>> Anyway, the problem here is that on MacOS X getaddrinfo() produces addresses
>> that sendto() does not like. I do not think it's possible that sendto() is
>> so broken (people would have noticed it before)...
>> Probably the problem is in the getaddrinfo()+sendto() combination.
>
> I may have an explanation. This is a wild guess, but it may work. In
> udp_ipv6_set_local, in the call to udp_ipv6_resolve_host at the very
> beginning, try to replace AF_UNSPEC by s->dest_addr.ss_family. I do not have
> time to test myself, and I do not have a macos box near at hand anyway.
Neither I have... Roland is the macos tester ;-)
> But I am afraid this hides some more protocol-related bugs.
This is what I fear (and this is why I am against applying the "sendto removal"
patch without fully understanding the issue)...
> I will try to look more deeply into it when I have time.
Thanks, that would be great.
[...]
> The point is, if you get, for example, "www.ripe.net" from the user, with
> the good old way, but assuming you want to support IPv6, you have to:
>
> (1) try to resolve it for an AAAA record;
> (2) try to create an INET6 socket;
> (3) try to connect to the address.
Well, when you do UDP streaming you do not really "connect" (this is the point
I was trying to make). UDP streaming is often "unidirectional": for example,
even when streaming RTP ffmpeg does not care about the RTCP RR packets sent back
by the client (they are mainly for statistical purpose, so this is not a problem).
So, if (1) and (2) do not fail, and ffmpeg starts streaming to an IPv6 address, it
might have no way to know if the client is correctly receiving, or if it wants the
data to the IPv4 address...
Anyway, I now realize that I was thinking about IP addresses (so, I was skipping
point 1 :). This is why everything looked simple to me (if I pass an IPv4 address as
destination, libavformat has to stream over IPv4, and if I pass an IPv6 address it
has to stream over IPv6). Considering the problem of resolving a host name into an
IP address, I see why getaddrinfo() is probably simpler.
Thanks,
Luca
More information about the ffmpeg-devel
mailing list