git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Don't crash if ai_canonname comes back as null

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2009, 16:57 UTC
Message-ID
<7viqkm5bc0.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<E1LzX1N-0003sw-2y@jdl.com>
Jon Loeliger <jdl@jdl.com> writes:
Show 5 quoted lines
>> > 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.

Previous: Jon LoeligerNext: Alex Riesen
Message 10 of 11 in “Workaround for ai_canonname sometimes coming back as null”
  1. Workaround for ai_canonname sometimes coming back as nullAugie Fackler, Apr 29, 2009
  2. Alex RiesenApr 29, 2009
  3. Augie FacklerApr 29, 2009
  4. Alex RiesenApr 29, 2009
  5. Alex RiesenApr 29, 2009
  6. Don't crash if ai_canonname comes back as nullAugie Fackler, Apr 29, 2009
  7. Junio C HamanoApr 29, 2009
  8. Augie FacklerApr 29, 2009
  9. Jon LoeligerApr 30, 2009
  10. Junio C HamanoApr 30, 2009
  11. Alex RiesenApr 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.