[FFmpeg-devel] [PATCH] IPv6 support v.2

Luca Abeni lucabe72
Wed Nov 7 17:42:09 CET 2007

Hi Nicolas,

Nicolas George wrote:
> Le septidi 17 brumaire, an CCXVI, Luca Abeni a ?crit :
>> For example, udp.c currently contains a lot of code duplication between
>> IPv6 and IPv4. I believe that removing this code duplication is the first
>> step.
> Nitpick: this is not IPv6 vs. IPv4,

I agree with you. By IPv6, I meant "the code that is currently under

> this is protocol-independent vs. IPv4-only.

Ok. And I believe that the protocol-independent code and the IPv4-only code
can be made very similar. Then, we can think about removing the IPv4-only

 > This means that in ideal circumstances, the former completely
> supersedes the latter.

Again, I agree... But we do not live in a perfect world. I fear that
committing a big patch which remove the IPv4-only code and switches to
the protocol-independent code might break someone's setup (we had 0
feedback from windows and beos users, for example). So, I'd like to
see this transition happening in small steps... In this way, if something
break we will have less changes to check.

> Ideal circumstances mean two things:
> - The protocol-independent version has been properly reviewed and debugged.
> - The operating system has the necessary functions.
> The key to achieve the first point is that everyone uses the code.

This is what currently happens, I hope. CONFIG_IPV6 is enabled by default,
and I think we fixed the big problems with it so people should have no
reason to use --disable-ipv6.

> For the second point, the "necessary functions" are getaddrinfo, and
> secondarily getnameinfo. These function have nothing magic, nor
> system-dependant, nor anything. It is perfectly possible to implement them
> on top of the legacy functions (gethostbyname and cousins); Stevens did it
> in UNP, it takes the best part of a chapter, but it works. Fortunately,
> ffmpeg (like most other programs) only uses a very small subset of
> getaddrinfo cases, and writing an implementation suitable for its needs
> would be just a matter of a few lines.
> Therefore, one possible course of action would be:
> - Simply drop the IPv4-only code.
> - If people complain that ffmpeg does not build anymore on their old
>   operating system, write a limited implementation of getaddrinfo.
As I said, I do not like this idea too much, and I'd prefer to arrive to
this result by committing small patches.

> Another solution, which is probably better, would be to move all
> network-related code somewhere together in libavutil.

I am not sure if network-related code would be accepted in libavutil.
And I do not see why moving it from libavformat to libavutil would
change anything ;-)

Anyway, as I wrote in the previous email these are just my personal
opinions; if someone else volunteers to take care of properly
integrating the IPv6 patches, I will be very happy to leave this
task to him/her.


More information about the ffmpeg-devel mailing list