On 1/26/24 18:17, Jillian Morgan wrote:
> 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.mor...@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'}) {

This only works for detecting Linux bridges, we would need to add an
additional check for OVS bridges as well

>           if (!$d->{ovs_type}) {
>               $d->{type} = 'bridge';
>               if (!defined ($d->{bridge_stp})) {
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 


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

Reply via email to