* [pve-devel] [PATCH] dns: powerdns: correctly handle different records types (A / AAAA)
@ 2025-02-27 9:02 Matthieu Pignolet via pve-devel
2025-03-13 16:14 ` Stefan Hanreich
0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Pignolet via pve-devel @ 2025-02-27 9:02 UTC (permalink / raw)
To: pve-devel; +Cc: Matthieu Pignolet
[-- Attachment #1: Type: message/rfc822, Size: 4604 bytes --]
From: Matthieu Pignolet <m@mpgn.dev>
To: pve-devel@lists.proxmox.com
Subject: [PATCH] dns: powerdns: correctly handle different records types (A / AAAA)
Date: Thu, 27 Feb 2025 13:02:27 +0400
Message-ID: <20250227090227.180317-1-m@mpgn.dev>
This fixes an issue with dual stacking, when using a zone with both a V4 and V6
subnet and the same dns suffix, pve-network will try to set both dns records (type A and AAAA) in the
same powerdns rrset, causing an api error, and effectively causing no forward dns records being created.
This change edits the `get_zone_rrset` function so that it takes the dns record type into account.
Signed-off-by: Matthieu Pignolet <m@mpgn.dev>
---
src/PVE/Network/SDN/Dns/PowerdnsPlugin.pm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/PVE/Network/SDN/Dns/PowerdnsPlugin.pm b/src/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
index dae63d1..70b7b80 100644
--- a/src/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
+++ b/src/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
@@ -57,7 +57,7 @@ sub add_a_record {
my $fqdn = $hostname.".".$zone.".";
my $zonecontent = get_zone_content($plugin_config, $zone);
- my $existing_rrset = get_zone_rrset($zonecontent, $fqdn);
+ my $existing_rrset = get_zone_rrset($zonecontent, $fqdn, $type);
my $final_records = [];
for my $record (@{$existing_rrset->{records}}) {
@@ -133,7 +133,7 @@ sub del_a_record {
my $type = Net::IP::ip_is_ipv6($ip) ? "AAAA" : "A";
my $zonecontent = get_zone_content($plugin_config, $zone);
- my $existing_rrset = get_zone_rrset($zonecontent, $fqdn);
+ my $existing_rrset = get_zone_rrset($zonecontent, $fqdn, $type);
my $final_records = [ grep { $_->{content} ne $ip } $existing_rrset->{records}->@* ];
my $final_records_size = scalar($final_records->@*);
@@ -278,10 +278,10 @@ sub get_zone_content {
}
sub get_zone_rrset {
- my ($zonecontent, $name) = @_;
+ my ($zonecontent, $name, $type) = @_;
for my $rrset (@{$zonecontent->{rrsets}}) {
- return $rrset if $rrset->{name} eq $name;
+ return $rrset if $rrset->{name} eq $name and ($rrset->{type} eq $type);
}
return; # not found
}
--
2.48.1
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] [PATCH] dns: powerdns: correctly handle different records types (A / AAAA)
2025-02-27 9:02 [pve-devel] [PATCH] dns: powerdns: correctly handle different records types (A / AAAA) Matthieu Pignolet via pve-devel
@ 2025-03-13 16:14 ` Stefan Hanreich
2025-03-24 17:01 ` Matthieu Pignolet via pve-devel
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hanreich @ 2025-03-13 16:14 UTC (permalink / raw)
To: Proxmox VE development discussion
Thanks for contributing to Proxmox VE! Have you already signed a CLA [1]
with us? Otherwise we cannot accept your contribution
Gave this patch a quick spin on my shiny new dual-stack Simple Zone with
DHCP enabled. Could reproduce the issue and the patch fixed it, so
consider this:
Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
[1] https://proxmox.com/en/about/open-source/developers
On 2/27/25 10:02, Matthieu Pignolet via pve-devel wrote:
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] [PATCH] dns: powerdns: correctly handle different records types (A / AAAA)
2025-03-13 16:14 ` Stefan Hanreich
@ 2025-03-24 17:01 ` Matthieu Pignolet via pve-devel
0 siblings, 0 replies; 3+ messages in thread
From: Matthieu Pignolet via pve-devel @ 2025-03-24 17:01 UTC (permalink / raw)
To: Stefan Hanreich; +Cc: Matthieu Pignolet, Proxmox VE development discussion
[-- Attachment #1: Type: message/rfc822, Size: 5043 bytes --]
From: Matthieu Pignolet <m@mpgn.dev>
To: Stefan Hanreich <s.hanreich@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH] dns: powerdns: correctly handle different records types (A / AAAA)
Date: Mon, 24 Mar 2025 21:01:21 +0400
Message-ID: <CAB+WsT1V93G_7thBwCzzPLvh_BymOvFKX67=i2LFPy4DsxUjYg@mail.gmail.com>
Thank you for giving my patch a spin.
The CLA was already signed under my name.
---
Matthieu Pignolet
On Thu, Mar 13, 2025 at 8:14 PM Stefan Hanreich <s.hanreich@proxmox.com>
wrote:
> Thanks for contributing to Proxmox VE! Have you already signed a CLA [1]
> with us? Otherwise we cannot accept your contribution
>
> Gave this patch a quick spin on my shiny new dual-stack Simple Zone with
> DHCP enabled. Could reproduce the issue and the patch fixed it, so
> consider this:
>
> Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
>
> [1] https://proxmox.com/en/about/open-source/developers
>
> On 2/27/25 10:02, Matthieu Pignolet via pve-devel wrote:
> > _______________________________________________
> > pve-devel mailing list
> > pve-devel@lists.proxmox.com
> > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
>
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-24 17:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-27 9:02 [pve-devel] [PATCH] dns: powerdns: correctly handle different records types (A / AAAA) Matthieu Pignolet via pve-devel
2025-03-13 16:14 ` Stefan Hanreich
2025-03-24 17:01 ` Matthieu Pignolet via pve-devel
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