all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Hannes Laimer <h.laimer@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH pve-network] sdn: controller: fallback to interface mac if no master
Date: Wed, 18 Feb 2026 10:56:21 +0100	[thread overview]
Message-ID: <o5evh66qemrqyydqzjthodvz4h3lsezfjwhv6v3x3sbc6g65da@ppqibiill33z> (raw)
In-Reply-To: <20260213063305.1979-1-h.laimer@proxmox.com>

On 13.02.2026 07:33, Hannes Laimer wrote:
> For IPv6 underlays, we can't directly use the IP for the router-id.
> Therefore, `get_router_id` derives a unique ID from the last 4 bytes of
> the interface MAC.
> 
> However, the current MAC retrieval logic only checks the master device.
> This fails for standalone interfaces that do not have a master, such as
> `dummy_` interfaces used for fabrics.
> 
> Update `read_iface_mac` to fall back to the interface's own address if
> no master address is found.
> 
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---

LGTM!

Consider:
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>

>  src/PVE/Network/SDN/Controllers/Plugin.pm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm
> index d70e518..cab036a 100644
> --- a/src/PVE/Network/SDN/Controllers/Plugin.pm
> +++ b/src/PVE/Network/SDN/Controllers/Plugin.pm
> @@ -105,7 +105,9 @@ sub on_update_hook {
>  
>  sub read_iface_mac {
>      my ($iface) = @_;
> -    return PVE::Tools::file_read_firstline("/sys/class/net/$iface/master/address");
> +    my $mac = PVE::Tools::file_read_firstline("/sys/class/net/$iface/master/address");
> +    return $mac if $mac;
> +    return PVE::Tools::file_read_firstline("/sys/class/net/$iface/address");
>  }
>  
>  sub get_router_id {
> -- 
> 2.47.3




      reply	other threads:[~2026-02-18  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13  6:33 Hannes Laimer
2026-02-18  9:56 ` Gabriel Goller [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=o5evh66qemrqyydqzjthodvz4h3lsezfjwhv6v3x3sbc6g65da@ppqibiill33z \
    --to=g.goller@proxmox.com \
    --cc=h.laimer@proxmox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal