]> git.proxmox.com Git - pve-cluster.git/commit
pmxcfs: check all addresses from getaddrinfo to find non-loopback one
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 30 Jun 2023 09:29:18 +0000 (11:29 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 1 Jul 2023 14:35:24 +0000 (16:35 +0200)
commitc78963b1c65cca9d812aed8fe97813bd6d4a12bd
tree5105c74068d3def5f8042e8ef5f9fcb23782c30c
parent0ddbd320f4289a35682f11cdb464225292dae051
pmxcfs: check all addresses from getaddrinfo to find non-loopback one

Make the resolution of the node name to a local non-loopback address
through getaddrinfo more flexible.

Don't just ask for one, but for all addresses, then loop through the
returned linked list until the first non-loopback one is found.

It seems that some cloud-init templates hosting providers, like e.g.
OVH use, are misconfigured in always adding 127.0.1.1 for the
hostname to /etc/hosts, even if another mapping for the hostname
exists already. This popped up in our community forum with the
upgrade to bookworm, so might be related to the cloud-init version
from Bookworm.

Some examples pointed out by Alexandre:
https://forum.proxmox.com/threads/129678/
https://forum.proxmox.com/threads/129669/#post-568172
https://forum.proxmox.com/threads/129398/#post-568290

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/pmxcfs/pmxcfs.c