From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9C7BB1FF0BC for ; Mon, 16 Nov 2026 17:12:06 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 290DE21482; Mon, 16 Nov 2026 17:12:04 +0100 (CET) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH pve-common v3 01/32] interfaces: preserve VRF membership across address family changes Date: Mon, 16 Nov 2026 17:11:21 +0100 Message-ID: <20261116161154.343743-2-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116161154.343743-1-g.goller@proxmox.com> References: <20261116161154.343743-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794845519535 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.229 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 6MUOUA2BGU4K5UUT4KWJT2TNOYTT2GJ5 X-Message-ID-Hash: 6MUOUA2BGU4K5UUT4KWJT2TNOYTT2GJ5 X-MailFrom: g.goller@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Store VRF membership as an interface option, not an address family option. Otherwise, switching from IPv4 to IPv6-only can drop the VRF assignment when the IPv4 stanza is removed. Signed-off-by: Gabriel Goller --- src/PVE/Network/Interfaces.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/Interfaces.pm b/src/PVE/Network/Interfaces.pm index 8aed1ab3c473..bfaab278d556 100644 --- a/src/PVE/Network/Interfaces.pm +++ b/src/PVE/Network/Interfaces.pm @@ -134,7 +134,7 @@ my $check_mtu = sub($ifaces, $parent, $child) { # gateway6 => IP, # comments6 => [ "..." ], # -# , # like bridge_ports, ovs_* +# , # interface-wide (shared by inet/inet6): bridge_ports, ovs_*, vrf # # # extra/unknown options stored by-family: # options => { ... } @@ -226,6 +226,7 @@ sub __read_etc_network_interfaces($fh, $ip_links = undef, $active_ifaces = undef my $simple_options = { 'mtu' => 1, + 'vrf' => 1, 'ovs_type' => 1, 'ovs_options' => 1, 'ovs_bridge' => 1, @@ -904,6 +905,7 @@ sub __write_etc_network_interfaces($config, $ifupdown2 = undef) { $n->{autostart} = 1; die "bond '$iface' - unable to find slave '$p'\n" if !$n; + die "bond '$iface' - slave '$p' cannot have a VRF master\n" if $n->{vrf}; die "bond '$iface' - wrong interface type on slave '$p' ('$n->{type}' != 'eth or bond')\n" if ($n->{type} ne 'eth' && $n->{type} ne 'bond'); @@ -1027,6 +1029,7 @@ sub __write_etc_network_interfaces($config, $ifupdown2 = undef) { } my $n = $ifaces_copy->{$p}; die "bridge '$iface' - unable to find bridge port '$p'\n" if !$n; + die "bridge '$iface' - port '$p' cannot have a VRF master\n" if $n->{vrf}; die "iface $p - ip address can't be set on interface if bridged in $iface\n" if ($n->{method} && $n->{method} eq 'static' && $n->{address} ne '0.0.0.0') || ($n->{method6} && $n->{method6} eq 'static' && $n->{address6} ne '::'); -- 2.47.3