Hello, On 2020-04-17 14:46:40 -0400, Rich Felker wrote: > Actually now that I'm doing this I'm not sure it's correct. The > existing code reports all matches from the hosts file, not just the > first one. This patch will prevent getting both ipv4 and ipv6 results, > or multiple results for the same address family, by stopping after the > first one. Well, I've completely missed that. Sorry. > If you want the canonical name to come from the first result, rather > than suppressing all but the first result, the code instead needs to > be changed to remember that it already found one name and not copy any > others. I've attached patch v2 doing exactly that. Hopefully this time it's correct. W. -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.