From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 456281FF140 for ; Fri, 13 Mar 2026 18:37:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 576FEA56D; Fri, 13 Mar 2026 18:37:33 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 13 Mar 2026 18:36:59 +0100 Message-Id: Subject: Re: [PATCH proxmox] fix #7329: proxmox-network-api: add missing `Auto` network config method From: "Shan Shaji" To: "Christian Ebner" , X-Mailer: aerc 0.20.0 References: <20260311101109.116215-1-s.shaji@proxmox.com> <829e80ef-1274-4ac7-9ebf-1c8fa0b55108@proxmox.com> In-Reply-To: <829e80ef-1274-4ac7-9ebf-1c8fa0b55108@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773423381261 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.947 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: PKWHAGPZNAVY2ZF7UOHW45I6QRKDDZM7 X-Message-ID-Hash: PKWHAGPZNAVY2ZF7UOHW45I6QRKDDZM7 X-MailFrom: s.shaji@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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu Mar 12, 2026 at 3:57 PM CET, Christian Ebner wrote: > Thanks for the patch, gave this a quick spin but ran into an issue. > > If I do have a network config containing e.g.: > ``` > auto nic1 > iface nic1 inet static > address 172.16.0.18/24 > > iface nic1 inet6 auto > ``` > and I go about to edit this NIC via the WebUI, e.g. adding a comment,=20 > the suggested diff would drop this, suggesting the following diff: > > ``` auto nic1 > iface nic1 inet static > address 172.16.0.18/24 > - > -iface nic1 inet6 auto > +#comment > ``` Hi Chris, Thank you very much for catching that. After digging into this a bit more, it looks like this happens in the inter= face update handler on the API side. If the inet6 address family's cidr6/gateway= 6 values are not set, interface.method6 value is mutated with `NetworkConfigMethod::Manu= al`: ``` if interface.cidr6.is_some() || interface.gateway6.is_some() { interface.method6 =3D Some(NetworkConfigMethod::Static); } else { interface.method6 =3D Some(NetworkConfigMethod::Manual); } ``` Later, when writing the config back, if the method6 value is `NetworkConfig= Method::Manual` and there are no IPv6 specific attributes present, the inet6 stanza gets sk= ipped: =20 ``` fn write_iface(iface: &Interface, w: &mut dyn Write) -> Result<(), Error> { [...] if let Some(method6) =3D iface.method6 { let mut skip_v6 =3D false; // avoid empty inet6 manual entry if iface.method.is_some() && method6 =3D=3D NetworkConfigMethod::Manual && iface.comments6.is_none() && iface.options6.is_empty() { skip_v6 =3D true; } if !skip_v6 { writeln!(w, "iface {} inet6 {}", iface.name, method_to_str(meth= od6))?; write_iface_attributes_v6(iface, w, method6)?; if iface.method.is_none() { // only write common attributes once write_iface_attributes(iface, w)?; } writeln!(w)?; } } Ok(()) } ``` > Can this easily be avoided? I was able to avoid this by changing the API-side update logic so that method6 is only set to `NetworkConfigMethod::Manual` if interface.method6 i= s not already set. I still want to do a bit more testing to make sure i am not missing anything.=20