all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH network] api: sdn: show full device name of firewall bridge ports
@ 2025-11-17 14:01 Gabriel Goller
  2025-11-17 14:04 ` Gabriel Goller
  2025-11-17 14:26 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Gabriel Goller @ 2025-11-17 14:01 UTC (permalink / raw)
  To: pve-devel

The bridges endpoint also returns the firewall ports of the bridges.
From the firewall port interface we extract the vmid and the vm network
device index. Instead of just showing a number, return the whole
`net{index}` name. This makes it easier to understand as the vm
configuration also shows `net{index}` as the key of the interfaces.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 src/PVE/API2/Network/SDN/Nodes/Zone.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/API2/Network/SDN/Nodes/Zone.pm b/src/PVE/API2/Network/SDN/Nodes/Zone.pm
index 43acbe9c203f..f86ad1ead271 100644
--- a/src/PVE/API2/Network/SDN/Nodes/Zone.pm
+++ b/src/PVE/API2/Network/SDN/Nodes/Zone.pm
@@ -180,7 +180,7 @@ __PACKAGE__->register_method({
                             index => {
                                 description =>
                                     'The index of the guests network device that this interface belongs to.',
-                                type => 'number',
+                                type => 'string',
                                 optional => 1,
                             },
                             primary_vlan => {
@@ -271,7 +271,7 @@ __PACKAGE__->register_method({
 
                 if ($ifname =~ m/^(?:fwpr(\d+)p(\d+)|veth(\d+)i(\d+)|tap(\d+)i(\d+))$/) {
                     $port->{vmid} = $1;
-                    $port->{index} = $2;
+                    $port->{index} = "net$2";
                 }
 
                 if ($result->{$master}->{vlan_filtering} == 1) {
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-17 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 14:01 [pve-devel] [PATCH network] api: sdn: show full device name of firewall bridge ports Gabriel Goller
2025-11-17 14:04 ` Gabriel Goller
2025-11-17 14:26 ` [pve-devel] applied: " Thomas Lamprecht

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal