[FFmpeg-devel] [PATCH] Use getaddrinfo in resolve_host (ipv6 support)

Andreas Öman andreas
Mon Sep 10 20:46:40 CEST 2007


Ronald S. Bultje wrote:
> Hi all,

> [*] url_split() is problematic because of ambiguity in host:port in
> ipv6-addresses. Valid ipv6 address representations are ::<num>,
> ::<num>:<num>, a:b:c:d:e:f:g:h and a:b:c:d:e:f:w.x.y.z and a variety of
> combinations between those, as long as there's only one :: in it (which
> means pad this with zeroes to make 8 shorts in total). Obviously, this leads
> to problems if we try to parse an address such as ::1:80, is this ::1 port
> 80 or 0:0:0:0:0:0:1:80? url_split() parses this as a host, which is what
> Apache does too. We support :::80 (tripple colons), full address notition
> with port (0:0:0:0:0:0:0:0:80, i.e. 8 colons), dotted notation for the last
> 4 bytes (::a.b.c.d:80) or space-separated notition (host port instead of
> host:port). Comments on this welcome.

I haven't examined your patch in detail, but rfc2732 deals with this
ambiguity by specifying that you should add brackets '[]' around
the address itself, like:


It's what a bunch of applications out there do and i think it would
be wise to have the same behavior in ffmpeg aswell.

More information about the ffmpeg-devel mailing list