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

[PATCH 0/5] transport: unify ipv4 and ipv6 code paths

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 8, 2012, 12:48 UTC
Message-ID
<20120308124857.GA7666@burratino>
Hi,

These patches eliminate some ifdef-ery concerning NO_IPV6. I used them when writing the SRV patch, which applies on top, but it's probably best to think of it as an independent topic.

Patch 4 is the heart of the series. It provides an interface similar to getaddrinfo that can be implemented on top of either gethostbyname or getaddrinfo and puts each implementation in a separate file. This way, callers can just use the common API and they do not need to have two copies of their code, one for each host resolution API.

Patches 1-3 move code around until all the code that patch 4 touches is in one place.

Patches 5 is a potential error handling improvement noticed while writing patches 1-4. It's probably not actually needed but it was a comfort to me.

These patches have been in use in Debian since June of last year. I'd like to see this in mainline early in the 1.7.11 cycle to make coding that touches this area during that cycle more pleasant. Thoughts of all kinds welcome.

Jonathan Nieder (5):
  transport: expose git_tcp_connect and friends in new tcp.h
  daemon: make host resolution into a separate function
  daemon: move locate_host() to tcp.c
  tcp: unify ipv4 and ipv6 code paths
  daemon: check for errors retrieving IP address
 Makefile   |    7 ++
 connect.c  |  277 +-----------------------------------------------------------
 daemon.c   |   58 ++-----------
 dns-ipv4.c |   33 ++++++++
 dns-ipv4.h |   68 +++++++++++++++
 dns-ipv6.c |   49 +++++++++++
 dns-ipv6.h |   31 +++++++
 tcp.c      |  217 +++++++++++++++++++++++++++++++++++++++++++++++
 tcp.h      |   11 +++
 9 files changed, 422 insertions(+), 329 deletions(-)
 create mode 100644 dns-ipv4.c
 create mode 100644 dns-ipv4.h
 create mode 100644 dns-ipv6.c
 create mode 100644 dns-ipv6.h
 create mode 100644 tcp.c
 create mode 100644 tcp.h
Next: Jonathan Nieder
Message 1 of 20 in “transport: unify ipv4 and ipv6 code paths”
  1. 0/5 transport: unify ipv4 and ipv6 code pathsJonathan Nieder, Mar 8, 2012
  2. 1/5 transport: expose git_tcp_connect() and friends in new tcp.hJonathan Nieder, Mar 8, 2012
  3. Erik Faye-LundMar 8, 2012
  4. 2/5 daemon: make host resolution a separate functionJonathan Nieder, Mar 8, 2012
  5. 3/5 daemon: move locate_host() to tcp libJonathan Nieder, Mar 8, 2012
  6. 4/5 tcp: unify ipv4 and ipv6 code pathsJonathan Nieder, Mar 8, 2012
  7. Erik Faye-LundMar 8, 2012
  8. Jonathan NiederMar 8, 2012
  9. 5/5 daemon: check for errors retrieving IP addressJonathan Nieder, Mar 8, 2012
  10. 6/5 tcp: make dns_resolve() return an error codeJonathan Nieder, Mar 8, 2012
  11. 7/5 transport: optionally honor DNS SRV recordsJonathan Nieder, Mar 8, 2012
  12. Erik Faye-LundMar 8, 2012
  13. Jonathan NiederMar 8, 2012
  14. Johannes SixtMar 9, 2012
  15. Jonathan NiederMar 9, 2012
  16. 8/5 srv: tolerate broken DNS repliesJonathan Nieder, Mar 8, 2012
  17. Richard HartmannMar 8, 2012
  18. Erik Faye-LundJun 11, 2012
  19. Junio C HamanoJun 11, 2012
  20. Jonathan NiederJun 14, 2012

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.