[pbs-devel] [PATCH proxmox 1/1] network-api: make address field optional

Stefan Hanreich s.hanreich at proxmox.com
Wed Aug 6 16:29:22 CEST 2025


Certain network interfaces do not have a MAC address, for instance
tailscale is layer-3 only, therefore the interfaces do not have a MAC
address. Make the address field optional to prevent the network
interface parsing logic from throwing an error in such cases.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 proxmox-network-api/src/config/helper.rs | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/proxmox-network-api/src/config/helper.rs b/proxmox-network-api/src/config/helper.rs
index 4f17b9ee..ca80d47f 100644
--- a/proxmox-network-api/src/config/helper.rs
+++ b/proxmox-network-api/src/config/helper.rs
@@ -137,7 +137,7 @@ pub struct IpLink {
     altnames: Vec<String>,
     ifindex: i64,
     link_type: String,
-    address: MacAddress,
+    address: Option<MacAddress>,
     linkinfo: Option<LinkInfo>,
     operstate: String,
 }
@@ -157,12 +157,10 @@ impl IpLink {
         &self.ifname
     }
 
-    pub fn permanent_mac(&self) -> MacAddress {
+    pub fn permanent_mac(&self) -> Option<MacAddress> {
         if let Some(link_info) = &self.linkinfo {
             if let Some(info_slave_data) = &link_info.info_slave_data {
-                if let Some(perm_hw_addr) = info_slave_data.perm_hw_addr {
-                    return perm_hw_addr;
-                }
+                return info_slave_data.perm_hw_addr;
             }
         }
 
-- 
2.47.2




More information about the pbs-devel mailing list