[pve-devel] [PATCH close #545, #5203: Allow bridges to have any valid interface name 2/2]

Jillian Morgan jillian.morgan at primordial.ca
Fri Jan 26 18:17:30 CET 2024


Detect bridge interface by bridge_ports attribute
Repo: pve-common

Similar to other interface types, we can detect a bridge by the presense of
it's bridge_ports attribute rather than solely relying on the "vmbr" ifname
prefix heuristic.

Signed-off-by: Jillian Morgan <jillian.morgan at primordial.ca>
---
 pve-common/src/PVE/INotify.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 6432295..9b45346 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1053,7 +1053,7 @@ sub __read_etc_network_interfaces {
 		my $tag = &$extract_ovs_option($d, 'tag');
 		$d->{ovs_tag} = $tag if defined($tag);
 	    }
-	} elsif ($iface =~ m/^vmbr\d+$/) {
+	} elsif ($iface =~ m/^vmbr\d+$/ || $d->{'bridge_ports'}) {
 	    if (!$d->{ovs_type}) {
 		$d->{type} = 'bridge';
 		if (!defined ($d->{bridge_stp})) {



More information about the pve-devel mailing list