* [PATCH pve-network] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin
@ 2026-08-24 13:42 Hannes Laimer
2026-08-26 9:25 ` Gabriel Goller
2026-08-26 10:18 ` applied: " Fiona Ebner
0 siblings, 2 replies; 3+ messages in thread
From: Hannes Laimer @ 2026-08-24 13:42 UTC (permalink / raw)
To: pve-devel
The subnet loop skipped every remaining subnet once a v6 address was
found, dropping a v4 record living in a later subnet. Which subnet comes
first is hash order, so in a dual-stack zone the v4 half of the answer
went missing at random. The intended v4 short-circuit never fired
either, since subnet keys are CIDR strings and ip_is_ipv4 returns false
for those.
Skip a subnet only when its own family is already answered.
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
index d2aba1e..a26da57 100644
--- a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
@@ -287,8 +287,9 @@ sub get_ips_from_mac {
my $subnets = $dbzone->{subnets};
for my $subnet (keys %$subnets) {
- next if Net::IP::ip_is_ipv4($subnet) && $ip4;
- next if $ip6;
+ # subnet keys are CIDRs, Net::IP only recognizes bare IPs
+ my ($network) = split(m|/|, $subnet);
+ next if Net::IP::ip_is_ipv4($network) ? $ip4 : $ip6;
my $ips = $subnets->{$subnet}->{ips};
for my $ip (keys %$ips) {
my $ipobject = $ips->{$ip};
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH pve-network] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin
2026-08-24 13:42 [PATCH pve-network] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin Hannes Laimer
@ 2026-08-26 9:25 ` Gabriel Goller
2026-08-26 10:18 ` applied: " Fiona Ebner
1 sibling, 0 replies; 3+ messages in thread
From: Gabriel Goller @ 2026-08-26 9:25 UTC (permalink / raw)
To: Hannes Laimer; +Cc: pve-devel
On 24.08.2026 15:42, Hannes Laimer wrote:
> The subnet loop skipped every remaining subnet once a v6 address was
> found, dropping a v4 record living in a later subnet. Which subnet comes
> first is hash order, so in a dual-stack zone the v4 half of the answer
> went missing at random. The intended v4 short-circuit never fired
> either, since subnet keys are CIDR strings and ip_is_ipv4 returns false
> for those.
>
> Skip a subnet only when its own family is already answered.
>
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
LGTM.
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
> ---
> src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* applied: [PATCH pve-network] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin
2026-08-24 13:42 [PATCH pve-network] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin Hannes Laimer
2026-08-26 9:25 ` Gabriel Goller
@ 2026-08-26 10:18 ` Fiona Ebner
1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-08-26 10:18 UTC (permalink / raw)
To: pve-devel, Hannes Laimer
On Mon, 24 Aug 2026 15:42:44 +0200, Hannes Laimer wrote:
> The subnet loop skipped every remaining subnet once a v6 address was
> found, dropping a v4 record living in a later subnet. Which subnet comes
> first is hash order, so in a dual-stack zone the v4 half of the answer
> went missing at random. The intended v4 short-circuit never fired
> either, since subnet keys are CIDR strings and ip_is_ipv4 returns false
> for those.
>
> [...]
Applied, thanks!
[1/1] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin
commit: ce388c5eec2376576d62a6be708439a64cf7fb62
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-26 10:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 13:42 [PATCH pve-network] sdn: ipam: fix dual-stack per-MAC lookup in the PVE plugin Hannes Laimer
2026-08-26 9:25 ` Gabriel Goller
2026-08-26 10:18 ` applied: " Fiona Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox