[pve-devel] [PATCH pve-common] Inotify : check bridgeport: fix vlan interface not defined

Alexandre Derumier aderumier at odiso.com
Tue Aug 28 13:31:53 CEST 2018


We can add to a bridge a non defined vlan interface.
We only need to check that physical interface exist

example
-------
auto eno1
iface eno1 inet manual

auto vmbr0
iface vmbr0 inet manual
	bridge_ports eno1.1
---
 src/PVE/INotify.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 6892b4c..4cf8699 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1404,6 +1404,7 @@ sub __write_etc_network_interfaces {
 	my $d = $ifaces->{$iface};
 	if ($d->{type} eq 'bridge') {
 	    foreach my $p (split (/\s+/, $d->{bridge_ports})) {
+		$p = $1 if ($p =~ m/^(\S+)\.\d+$/);
 		my $n = $ifaces->{$p};
 		die "bridge '$iface' - unable to find bridge port '$p'\n"
 		    if !$n;
-- 
2.11.0




More information about the pve-devel mailing list