public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>,
	"pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>,
	"aderumier@odiso.com" <aderumier@odiso.com>
Subject: Re: [pve-devel] [PATCH pve-cluster] pve-cluster.service : remove 127.0.1.1 from /etc/hosts
Date: Wed, 28 Jun 2023 10:13:27 +0200	[thread overview]
Message-ID: <e79e3a4f-d20b-8dbf-4927-d94683e9a019@proxmox.com> (raw)
In-Reply-To: <e85522c8a61f1e161fa0796af0c9abdd799c8704.camel@groupe-cyllene.com>

Am 28/06/2023 um 09:47 schrieb DERUMIER, Alexandre:
>> Let's rather improve pmxcfs logic for getting the non-local IP
>> configured on
>> a node via getaddrinfo with the ALL flag and filtering out local
>> IPs..
> oh, I didn't known than getaddrinfo could return multiple ips.

yes, check the "getaddrinfo_all" method in PVE::Tools and how it's used
in the "get_local_ip" method in PVE::Network.

> (I thinked it was doing a simple dns resolution)
> I'll look at that, thanks !
> 

if you don't get to it I would take a look tomorrow – as yes, this is indeed
annoying and it seems that quite some users are affected, at least relatively
speaking.


im pmxcfs.c one would need to adapt lookup_node_ip, mostly set the flags for
the ahints struct directly, the memset to zero should not be required then
any more, i.e.:

struct addrinfo ahints = { 
    .ai_flags = AI_V4MAPPED | AI_ALL
};

and then wrap the existing code into a loop, returning once the first non-local
IP was found, something like:

for (struct addrinfo addr = ainfo; addr != NULL; addr = addr->ai_next) {
    // ...
}

so it shouldn't be _that_ hard.




      reply	other threads:[~2023-06-28  8:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28  6:06 Alexandre Derumier
2023-06-28  7:28 ` Thomas Lamprecht
2023-06-28  7:47   ` DERUMIER, Alexandre
2023-06-28  8:13     ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e79e3a4f-d20b-8dbf-4927-d94683e9a019@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=aderumier@odiso.com \
    --cc=alexandre.derumier@groupe-cyllene.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal