* [pve-devel] [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports
@ 2025-09-15 8:47 Gabriel Goller
2025-09-15 10:42 ` Thomas Lamprecht
2025-09-16 10:10 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 4+ messages in thread
From: Gabriel Goller @ 2025-09-15 8:47 UTC (permalink / raw)
To: pve-devel
When creating a vlan zone and vnet, we get all the bridge interfaces
(slaves) and add them to the new vlan bridge. We get all the bridge
interfaces using `/sys/class/net` and then filter them using a regex.
This regex was missing the new `if` and `nic` prefixes which were
introduced with the pve-network-interface-pinning tool.
This is more of a stop-gap, we can probably remove the regex completely
as I don't see any reason to filter by "physical" interfaces here. If
there is a need, we can still run `ip link` and check the attributes
with `PVE::Network::ip_link_is_physical`.
Fixes: #6806
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
src/PVE/Network/SDN/Zones/Plugin.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/Network/SDN/Zones/Plugin.pm b/src/PVE/Network/SDN/Zones/Plugin.pm
index 83372e703cf5..0a977fd35a13 100644
--- a/src/PVE/Network/SDN/Zones/Plugin.pm
+++ b/src/PVE/Network/SDN/Zones/Plugin.pm
@@ -371,7 +371,7 @@ sub get_bridge_ifaces {
my $dir = "/sys/class/net/$bridge/brif";
PVE::Tools::dir_glob_foreach(
$dir,
- '(((eth|bond)\d+|en[^.]+)(\.\d+)?)',
+ '(((eth|bond|nic|if)\d+|en[^.]+)(\.\d+)?)',
sub {
push @bridge_ifaces, $_[0];
},
--
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] 4+ messages in thread
* Re: [pve-devel] [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports
2025-09-15 8:47 [pve-devel] [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports Gabriel Goller
@ 2025-09-15 10:42 ` Thomas Lamprecht
2025-09-15 10:51 ` Gabriel Goller
2025-09-16 10:10 ` [pve-devel] applied: " Thomas Lamprecht
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Lamprecht @ 2025-09-15 10:42 UTC (permalink / raw)
To: Proxmox VE development discussion, Gabriel Goller
Am 15.09.25 um 10:48 schrieb Gabriel Goller:
> When creating a vlan zone and vnet, we get all the bridge interfaces
> (slaves) and add them to the new vlan bridge. We get all the bridge
> interfaces using `/sys/class/net` and then filter them using a regex.
> This regex was missing the new `if` and `nic` prefixes which were
> introduced with the pve-network-interface-pinning tool.
>
> This is more of a stop-gap, we can probably remove the regex completely
> as I don't see any reason to filter by "physical" interfaces here. If
> there is a need, we can still run `ip link` and check the attributes
> with `PVE::Network::ip_link_is_physical`.
We allow bond already now though, so replacing the current check with the
ip_link_is_physical would not really be an option FWICT.
Reversing the regex to filter out stuff that quite definitively does not
make sense might be a better approach, like:
^(?!((fw(br|pr|ln)|tap|veth)\d+((p|i)\d+)?))
But really not that much more maintainable ;-) So even if it should result
in the same list, it might be better to replace dir_glob_foreach with
"manually" doing the loop here and use dedicated simple "next if expression"
checks to skip the interfaces that cannot make sense.
But your stop gap is already improving the status quo, so it's fine to
apply this patch here now already.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports
2025-09-15 10:42 ` Thomas Lamprecht
@ 2025-09-15 10:51 ` Gabriel Goller
0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Goller @ 2025-09-15 10:51 UTC (permalink / raw)
To: Thomas Lamprecht; +Cc: Proxmox VE development discussion
On 15.09.2025 12:42, Thomas Lamprecht wrote:
>Am 15.09.25 um 10:48 schrieb Gabriel Goller:
>> When creating a vlan zone and vnet, we get all the bridge interfaces
>> (slaves) and add them to the new vlan bridge. We get all the bridge
>> interfaces using `/sys/class/net` and then filter them using a regex.
>> This regex was missing the new `if` and `nic` prefixes which were
>> introduced with the pve-network-interface-pinning tool.
>>
>> This is more of a stop-gap, we can probably remove the regex completely
>> as I don't see any reason to filter by "physical" interfaces here. If
>> there is a need, we can still run `ip link` and check the attributes
>> with `PVE::Network::ip_link_is_physical`.
>
>We allow bond already now though, so replacing the current check with the
>ip_link_is_physical would not really be an option FWICT.
Ah yeah true.
>Reversing the regex to filter out stuff that quite definitively does not
>make sense might be a better approach, like:
>
>^(?!((fw(br|pr|ln)|tap|veth)\d+((p|i)\d+)?))
>
>But really not that much more maintainable ;-) So even if it should result
>in the same list, it might be better to replace dir_glob_foreach with
>"manually" doing the loop here and use dedicated simple "next if expression"
>checks to skip the interfaces that cannot make sense.
>
>But your stop gap is already improving the status quo, so it's fine to
>apply this patch here now already.
Agree.
I'll discuss with Stefan later (he's on vacation this week) if we can
remove this altogether.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied: [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports
2025-09-15 8:47 [pve-devel] [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports Gabriel Goller
2025-09-15 10:42 ` Thomas Lamprecht
@ 2025-09-16 10:10 ` Thomas Lamprecht
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2025-09-16 10:10 UTC (permalink / raw)
To: pve-devel, Gabriel Goller
On Mon, 15 Sep 2025 10:47:59 +0200, Gabriel Goller wrote:
> When creating a vlan zone and vnet, we get all the bridge interfaces
> (slaves) and add them to the new vlan bridge. We get all the bridge
> interfaces using `/sys/class/net` and then filter them using a regex.
> This regex was missing the new `if` and `nic` prefixes which were
> introduced with the pve-network-interface-pinning tool.
>
> This is more of a stop-gap, we can probably remove the regex completely
> as I don't see any reason to filter by "physical" interfaces here. If
> there is a need, we can still run `ip link` and check the attributes
> with `PVE::Network::ip_link_is_physical`.
>
> [...]
Applied, thanks!
[1/1] fix #6806: sdn: allow nic* and if* interfaces as bridge ports
commit: 4f19480b04315afb5dc23e0130463acaea35db18
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-16 10:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-15 8:47 [pve-devel] [PATCH network] fix #6806: sdn: allow nic* and if* interfaces as bridge ports Gabriel Goller
2025-09-15 10:42 ` Thomas Lamprecht
2025-09-15 10:51 ` Gabriel Goller
2025-09-16 10:10 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox