[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] Don't crash if ai_canonname comes back as null
From:       Junio C Hamano <gitster () pobox ! com>
Date:       2009-04-30 16:57:03
Message-ID: 7viqkm5bc0.fsf () gitster ! siamese ! dyndns ! org
[Download RAW message or body]

Jon Loeliger <jdl@jdl.com> writes:

>> > I've been waiting for feedback to a patch proposed earlier in the same
>> > area, which is <49F5BA55.3060606@googlemail.com> ($gmane/117670).  How
>> > does this new one relate to it?
>> ... 
> So, I wasn't CC'ed on the referenced patch ($gmane/117670), but it

You did got CC'ed, but I got a bounce from your freescale address, so this
time I tried another address of yours I knew about.

> seems to me that there might be value in actually looping over the
> whole list of addrinfo results exactly in the case that it does
> return a null canonical name for one of its addresses?

That is what I speculated when commenting on ($gmane/117670), but I think
the original loop was not doing any check, and instead always exited early
during its first iteration.  Perhaps we can re-add a loop that does
something useful, but I do not know what it would be offhand.

> Perhaps an
> inverse call to getnameinfo() is warranted too?

In this case the name being looked up is _ours_; it is not like "the
client claims to be frotz---does frotz reverse map to him correctly?"
situation, so reverse lookup might not be so interesting.

There is one thing that could potentially be useful when the daemon runs
on a multi-homed host; git.jdl.com may have eth1 facing public and eth0
facing internal networks.  Depending on which address you got the request
to, you may want to serve different contents, and if you got request to
"hostname" that is not you as far as getaddrinfo() is concerned, you may
want to do yet another thing that is different from the two name-addr
mapping returned by getaddrinfo().

I do not see enough information to do that kind of thing is passed to the
parse_extra_args() function in the current callchain, though.  We do have
a call to getpeername() but we do not seem to do getsockname() to learn
about our end of the connection.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic