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>