From: Stefan Sperling Subject: Re: remove host, host_v4 and host_v6; rename host_dns -> host To: Omar Polo Cc: gameoftrees@openbsd.org Date: Mon, 29 May 2023 18:49:42 +0200 On Mon, May 29, 2023 at 06:35:02PM +0200, Omar Polo wrote: > This is an attempt at simplifying how host() works. host() is used in > the configuration file via get_addrs() to prepare a struct address > after a "listen on" directive > > The current code first tries to resolve it as an ipv4 address via > inet_pton(), then as an ipv6 address using getaddrinfo() with > AI_NUMERICHOST, then as an interface name and finally as a name to > resolve via getaddrinfo() again. > > Instead, scratch host(), host_v4() and host_v6() and rename host_dns() > to host(). It preserve the lookup via interface name, and then uses > getaddrinfo() only once wich already knows how to deal with IPv4/v6 > literals and resolving addresses too. > > ok? Makes sense to me, ok.