When using an interface without a firewall on a VM or container, it results in tap<vmid>i<index> or veth<vmid>i<index> bridge ports. Previously, a single regex with multiple options caused incorrect capture group variables, $1 and $2 would always refer to the first group (fwpr) even if we matched on e.g. `veth`. Split into separate matches.
Signed-off-by: Gabriel Goller <[email protected]> Reported-by: Friedrich Weber <[email protected]> --- src/PVE/API2/Network/SDN/Nodes/Zone.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/Network/SDN/Nodes/Zone.pm b/src/PVE/API2/Network/SDN/Nodes/Zone.pm index f86ad1ead271..c1e48da70dd1 100644 --- a/src/PVE/API2/Network/SDN/Nodes/Zone.pm +++ b/src/PVE/API2/Network/SDN/Nodes/Zone.pm @@ -269,7 +269,13 @@ __PACKAGE__->register_method({ name => $ifname, }; - if ($ifname =~ m/^(?:fwpr(\d+)p(\d+)|veth(\d+)i(\d+)|tap(\d+)i(\d+))$/) { + if ($ifname =~ m/^fwpr(\d+)p(\d+)$/) { + $port->{vmid} = $1; + $port->{index} = "net$2"; + } elsif ($ifname =~ m/^veth(\d+)i(\d+)$/) { + $port->{vmid} = $1; + $port->{index} = "net$2"; + } elsif ($ifname =~ m/^tap(\d+)i(\d+)$/) { $port->{vmid} = $1; $port->{index} = "net$2"; } -- 2.47.3 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
