[FFmpeg-devel] [PATCH] Make RTP work with IPv6 enabled
Mon Oct 29 16:16:54 CET 2007
Nicolas George wrote:
> L'octidi 8 brumaire, an CCXVI, Luca Abeni a ?crit :
>> However... I decided to have a look at this getaddrinfo() stuff, and the
>> first thing that linux manpages say is "creates one or more socket address
>> structures that can be used by the bind(2) and connect(2)". sendto() is
>> not mentioned. So, I am wondering if an address prepared by getaddrinfo()
>> can be used by sendto() or not (it works on Linux, but maybe it is not
>> required to work?).
> Single Unix just says "socket address". I believe that the mention of bind
> and connect in the Linux manpage is just an example.
Ok, that was just a guess... I found the getaddrinfo() description on
opengroup.org, and now I understand this stuff better.
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.
>> Even after reading Nicolas message, I still do not understand why the good
>> old way of filling sockaddr structures should be replaced with this...
> There are two problems with the good old way:
> - The size of the address structure is not a compile-time constant, nor are
> the layout of its fields.
Well, sizeof(struct sockaddr_in) for IPv4, and sizeof(<whatever an IPv6 address is>)
for IPv6 should do the job, no? Or are you saying that an IPv6 address cannot be
stored in a fixed-size structure?
> - It is necessary to try several addresses in order to find one that work
> (unless you want to let the user do it).
Uhmmm... Not sure this is the case for RTP/UDP streaming. When you stream
over UDP, you just send UDP packets to a <destination address>:<port>,
and that's a single address.
Note: I am not opposed to your patch (in fact, I already said that I'd like
to see it applied). I am just trying to understand why things that I used to
code in few lines need to be so complex when done properly :)
More information about the ffmpeg-devel