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

Re: [PATCH/RFC] daemon.c: replace inet_ntop with getnameinfo

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 7, 2009, 13:15 UTC
Message-ID
<4A02DEE3.1080006@viscovery.net>
In-Reply-To
<EC96A79E-4D4E-467A-A10F-D905FE02E508@gmail.com>
Benjamin Kramer schrieb:
Show 19 quoted lines
> git daemon has a feature called interpolated paths
> 
> If git daemon is started like this:
>     git daemon --interpolated-path=%IP/%D
> (the machine has two IPs: 123.123.123.123 (v4) and 2001:db8::1 (v6))
> and someone clones a repository:
>     git clone git://123.123.123.123/frotz
> git daemon will look for the repository in the directory
> `123.123.123.123/frotz'
> 
> But if git daemon listens on the IPv6 interface and someone clones a
> repository:
>     git clone git://2001:db8::1/frotz
> Then git daemon will look for the repository in `0.0.0.0/frotz'
> 
> My patch makes it converting IPv6 addresses properly and if you the clone
> in my previous example it'll now look in `2001:db8::1/frotz' (with
> colons in the
> directory name)

I don't particularly care about git-daemon on Windows at this time because we don't build it anyway. But others have already had limited success, and they might care since getnameinfo() is not available. If we did have IPv6 support on Windows, we would indeed have troubles with those path names.

But even on non-Windows, a directory name with colons does not look kosher to me. Don't they look like PATH values? Or like remote addresses? Are IPv6 addresses used in this way by other software?

Moreover, I think that since IPv6 addresses can have at most one '::' abbreviation, but not in an unambiguous way, users of path-interpolation of IPv6 addresses are at the mercy of whether and how getnameinfo() makes use of '::'.

-- Hannes
Previous: Benjamin KramerNext: Benjamin Kramer
Message 4 of 8 in “daemon.c: replace inet_ntop with getnameinfo”
  1. daemon.c: replace inet_ntop with getnameinfoBenjamin Kramer, May 7, 2009
  2. Andreas EricssonMay 7, 2009
  3. Benjamin KramerMay 7, 2009
  4. Johannes SixtMay 7, 2009
  5. Benjamin KramerMay 7, 2009
  6. Jakub NarebskiMay 7, 2009
  7. Brian GernhardtMay 7, 2009
  8. Miles BaderMay 7, 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.