[FFmpeg-devel] [PATCH/RFC] Prefer getaddrinfo over gethostbyname

Martin Storsjö martin
Wed Jan 20 16:37:39 CET 2010

On Wed, 20 Jan 2010, Ronald S. Bultje wrote:

> 2010/1/20 M?ns Rullg?rd <mans at mansr.com>:
> > Why don't you use the system struct sockaddr instead of trying to
> > replicate it? ?If it's not big enough for ipv6 addresses, the system
> > clearly doesn't support ipv6 in the first place.
> See RFC-2553 (http://www.rfc-editor.org/rfc/rfc2553.txt). struct
> sockaddr_storage is expected to be of that size and should contain a
> ss_family member at the very least.
> I agree making it that big is not necessary for most purposes, but
> we're trying to tear apart the "do I have ipv6 or not" issue (which is
> really a kernel thing, and can differ per system) from the
> availability of some structs on the build system. At some point, we
> might be able to build binaries that work and support "whatever's
> best" on both win2k (ipv4-only) and winxp (ipv6-also), all in the same
> binary.
> I think the patch is a good idea (will review in a bit).

Here's an updated version, taking M?ns' comments into account.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-for-the-sa_len-member-in-struct-sockaddr.patch
Type: text/x-diff
Size: 1310 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100120/6c1a36fa/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-proper-fields-to-the-struct-sockaddr_storage-rep.patch
Type: text/x-diff
Size: 1139 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100120/6c1a36fa/attachment-0001.patch>

More information about the ffmpeg-devel mailing list