Subject: Re: [PATCH 5/6] tcp: unify ipv4 and ipv6 code paths

From: Jonathan Nieder <[email-masked]>
Date: Mon, 6 Jun 2011 05:01:47 -0500

Jonathan Nieder wrote:

>                  tells getaddrinfo to restrict attention to TCP
> services after this patch.  That should make a difference because the
> service parameter is NULL.

Sorry, the last sentence should say "That should _not_ make a
difference".  You would be able to tell the difference between the
before and after with "strace git daemon" because of the ai_socktype
and ai_protocol settings:

[...]
> +int dns_resolve(const char *host, const char *port, int flags,
> +		resolver_result *res)
> +{
> +	struct addrinfo hints;
> +	int gai;
> +
> +	memset(&hints, 0, sizeof(hints));
> +	if (flags & RESOLVE_CANONNAME)
> +		hints.ai_flags = AI_CANONNAME;
> +	hints.ai_socktype = SOCK_STREAM;
> +	hints.ai_protocol = IPPROTO_TCP;
> +
> +	gai = getaddrinfo(host, port, &hints, res);

but I don't think the effect is any different --- the ai_socktype and
protocol hints are for getservbyname functionality and the code that
cares about it was already passing those hints.