git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jon Loeliger <jdl@jdl.com>
Cc: Augie Fackler <durin42@gmail.com>,
	Alex Riesen <raa.lkml@gmail.com>,
	git@vger.kernel.org, Benjamin Kramer <benny.kra@googlemail.com>
Subject: Re: [PATCH] Don't crash if ai_canonname comes back as null
Date: Thu, 30 Apr 2009 09:57:03 -0700	[thread overview]
Message-ID: <7viqkm5bc0.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: E1LzX1N-0003sw-2y@jdl.com

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.

  reply	other threads:[~2009-04-30 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 21:48 [PATCH] Workaround for ai_canonname sometimes coming back as null Augie Fackler
2009-04-29 21:55 ` Alex Riesen
2009-04-29 21:56   ` Augie Fackler
2009-04-29 22:01     ` Alex Riesen
2009-04-29 22:04     ` Alex Riesen
2009-04-29 23:04       ` [PATCH] Don't crash if ai_canonname comes " Augie Fackler
2009-04-29 23:21         ` Junio C Hamano
2009-04-29 23:32           ` Augie Fackler
2009-04-30 14:13             ` Jon Loeliger
2009-04-30 16:57               ` Junio C Hamano [this message]
2009-04-29 21:56   ` [PATCH] Workaround for ai_canonname sometimes coming " Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7viqkm5bc0.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=benny.kra@googlemail.com \
    --cc=durin42@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jdl@jdl.com \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).