* [PATCH proxmox{,-backup} v2 0/2] fix #7329: network: unkwown iface option error
@ 2026-03-16 15:20 Shan Shaji
2026-03-16 15:21 ` [PATCH proxmox v2 1/1] fix #7329: proxmox-network-api: add missing `Auto` network config method Shan Shaji
2026-03-16 15:21 ` [PATCH proxmox-backup v2 1/1] fix #7329: api: avoid overwriting existing IPv6 " Shan Shaji
0 siblings, 2 replies; 3+ messages in thread
From: Shan Shaji @ 2026-03-16 15:20 UTC (permalink / raw)
To: pbs-devel
Using `inet6 auto` resulted in an error message in the web GUI. To fix
the issue, I added the `Auto` config method variant to the `NetworkConfigMethod` enum.
This fixed the error in the web GUI, but when editing the interface through the UI,
the `inet6 (auto)` family was still being removed.
For example, if I updated only the comment for the interface, the `auto` method was dropped.
This happened because, when editing the interface without providing
`cidr6` or `gateway6` values, the config method was being replaced
with `Manual` regardless of the current `inet6` method from the existing config.
Later, when writing the config to interfaces.new file if the config method was
`Manual` and there were no values present inside the `inet6` block, then the
entire stanza was removed.
To fix this, the `inet6` config method is now set to `Manual` only if the
interface method6 prop does not already have a value.
changes since v1: Thanks @chris
- added `fixes` trailer.
- fixed typo s/Inorder/In order
- api: fixed inet6 stanza getting dropped.
#### Testing
- added a new bridge interface from the web UI.
- manually added inet6 (auto) address family to /etc/network/interfaces file for the
bridge interface.
- now from web ui, added a comment for the same interface.
- verified if the block is getting removed. The comment was added and the block
not getting removed.
- Now updated the vmbr0 IPv4/CIDR value.
- verified if the method changed from manual to static.
- updated the vmbr0 IPv6/CIDR value.
- verified if the method changed from auto to static.
proxmox:
Shan Shaji (1):
fix #7329: proxmox-network-api: add missing `Auto` network config
method
proxmox-network-api/src/api_types.rs | 2 ++
proxmox-network-api/src/config/mod.rs | 1 +
proxmox-network-api/src/config/parser.rs | 43 ++++++++++++++++++++++++
3 files changed, 46 insertions(+)
proxmox-backup:
Shan Shaji (1):
fix #7329: api: avoid overwriting existing IPv6 config method
src/api2/node/network.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Summary over all repositories:
4 files changed, 47 insertions(+), 1 deletions(-)
--
Generated by git-murpp 0.8.1
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH proxmox v2 1/1] fix #7329: proxmox-network-api: add missing `Auto` network config method
2026-03-16 15:20 [PATCH proxmox{,-backup} v2 0/2] fix #7329: network: unkwown iface option error Shan Shaji
@ 2026-03-16 15:21 ` Shan Shaji
2026-03-16 15:21 ` [PATCH proxmox-backup v2 1/1] fix #7329: api: avoid overwriting existing IPv6 " Shan Shaji
1 sibling, 0 replies; 3+ messages in thread
From: Shan Shaji @ 2026-03-16 15:21 UTC (permalink / raw)
To: pbs-devel
when adding an iface object with network type as inet6 and the config
type as auto, the web UI was showing an error inside the "Network
interfaces" section. This was because the `NetworkParser` failed to
parse the auto method. In order to fix the issue, add new `Auto` variant
inside the `NetworkConfigMethod` enum and update the match clause to
handle `Auto` variant.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7329
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v1:
- added `Fixes` trailer.
- fixed typo s/Inorder/In order
proxmox-network-api/src/api_types.rs | 2 ++
proxmox-network-api/src/config/mod.rs | 1 +
proxmox-network-api/src/config/parser.rs | 43 ++++++++++++++++++++++++
3 files changed, 46 insertions(+)
diff --git a/proxmox-network-api/src/api_types.rs b/proxmox-network-api/src/api_types.rs
index 4860a114..b86f8570 100644
--- a/proxmox-network-api/src/api_types.rs
+++ b/proxmox-network-api/src/api_types.rs
@@ -37,6 +37,8 @@ pub enum NetworkConfigMethod {
DHCP,
/// Define the loopback interface.
Loopback,
+ /// Define interfaces with automatically assigned IPv6 addresses.
+ Auto,
}
#[api()]
diff --git a/proxmox-network-api/src/config/mod.rs b/proxmox-network-api/src/config/mod.rs
index 9b9f0d50..84fdff86 100644
--- a/proxmox-network-api/src/config/mod.rs
+++ b/proxmox-network-api/src/config/mod.rs
@@ -177,6 +177,7 @@ fn write_iface(iface: &Interface, w: &mut dyn Write) -> Result<(), Error> {
NetworkConfigMethod::Loopback => "loopback",
NetworkConfigMethod::Manual => "manual",
NetworkConfigMethod::DHCP => "dhcp",
+ NetworkConfigMethod::Auto => "auto",
}
}
diff --git a/proxmox-network-api/src/config/parser.rs b/proxmox-network-api/src/config/parser.rs
index 8cbc6ac8..dafe19f8 100644
--- a/proxmox-network-api/src/config/parser.rs
+++ b/proxmox-network-api/src/config/parser.rs
@@ -461,6 +461,7 @@ impl<R: BufRead> NetworkParser<R> {
Token::Static => config_method = Some(NetworkConfigMethod::Static),
Token::Manual => config_method = Some(NetworkConfigMethod::Manual),
Token::DHCP => config_method = Some(NetworkConfigMethod::DHCP),
+ Token::Auto => config_method = Some(NetworkConfigMethod::Auto),
_ => bail!("unknown iface option {}", text),
}
}
@@ -742,6 +743,48 @@ mod test {
Ok(())
}
+ #[test]
+ fn test_network_config_parser_ipv6_variants() -> Result<(), Error> {
+ let input = "auto lo\n\
+ iface lo inet6 loopback\n\
+ \n\
+ auto ens18\n\
+ iface ens18 inet6 auto\n\
+ \n\
+ auto ens20\n\
+ iface ens20 inet6 static\n\
+ \taddress 2001:db8:a::1/64\n\
+ \tgateway 2001:db8:a::fe\n\
+ \n\
+ auto ens21\n\
+ iface ens21 inet6 dhcp\n";
+
+ let mut parser = NetworkParser::new(input.as_bytes());
+
+ let config = parser.parse_interfaces(None)?;
+
+ let output = String::try_from(config)?;
+
+ let expected = "auto lo\n\
+ iface lo inet6 loopback\n\
+ \n\
+ auto ens18\n\
+ iface ens18 inet6 auto\n\
+ \n\
+ auto ens20\n\
+ iface ens20 inet6 static\n\
+ \taddress 2001:db8:a::1/64\n\
+ \tgateway 2001:db8:a::fe\n\
+ \n\
+ auto ens21\n\
+ iface ens21 inet6 dhcp\n\
+ \n";
+
+ assert_eq!(output, expected);
+
+ Ok(())
+ }
+
#[test]
fn test_network_config_parser_no_blank_2() -> Result<(), Error> {
// Adapted from bug 2926
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH proxmox-backup v2 1/1] fix #7329: api: avoid overwriting existing IPv6 config method
2026-03-16 15:20 [PATCH proxmox{,-backup} v2 0/2] fix #7329: network: unkwown iface option error Shan Shaji
2026-03-16 15:21 ` [PATCH proxmox v2 1/1] fix #7329: proxmox-network-api: add missing `Auto` network config method Shan Shaji
@ 2026-03-16 15:21 ` Shan Shaji
1 sibling, 0 replies; 3+ messages in thread
From: Shan Shaji @ 2026-03-16 15:21 UTC (permalink / raw)
To: pbs-devel
If the inet6 address family's cidr6/gatway6 values are not present, the
interface.method6 values is mutated with `NetworkConfigMethod::Manual`
even if the interface.method6 already has a value. For example, if
the config method is `auto` then it gets replaced by `Manual` config
method.
Later, when writing the config file to the interfaces.new file if the
config method is manual and if there are no IPv6 specific attributes
present, then the inet6 stanza gets skipped.
In order to fix the issue update the condition to only set the config
method to `::Manual` if there is no value present inside the `method6`
property of the interface object.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7329
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
**note**: This is a new patch.
src/api2/node/network.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/api2/node/network.rs b/src/api2/node/network.rs
index 4ee0231d..d0a04e59 100644
--- a/src/api2/node/network.rs
+++ b/src/api2/node/network.rs
@@ -782,7 +782,7 @@ pub fn update_interface(
if interface.cidr6.is_some() || interface.gateway6.is_some() {
interface.method6 = Some(NetworkConfigMethod::Static);
- } else {
+ } else if interface.method6.is_none() {
interface.method6 = Some(NetworkConfigMethod::Manual);
}
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-16 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-16 15:20 [PATCH proxmox{,-backup} v2 0/2] fix #7329: network: unkwown iface option error Shan Shaji
2026-03-16 15:21 ` [PATCH proxmox v2 1/1] fix #7329: proxmox-network-api: add missing `Auto` network config method Shan Shaji
2026-03-16 15:21 ` [PATCH proxmox-backup v2 1/1] fix #7329: api: avoid overwriting existing IPv6 " Shan Shaji
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.