]> git.proxmox.com Git - pve-common.git/commitdiff
Inotify: check bridgeport: fix vlan interface not defined
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 28 Aug 2018 11:31:53 +0000 (13:31 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 11 Sep 2018 12:13:33 +0000 (14:13 +0200)
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

[w.bumiller@proxmox.com: style & commit message fixup]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/INotify.pm

index e37b4af6b5994b02b060e04511e473f1ea00d5f2..fc9471d47d20f988e96b4d634535a061853012d4 100644 (file)
@@ -1409,6 +1409,7 @@ sub __write_etc_network_interfaces {
        my $d = $ifaces->{$iface};
        if ($d->{type} eq 'bridge') {
            foreach my $p (split (/\s+/, $d->{bridge_ports})) {
        my $d = $ifaces->{$iface};
        if ($d->{type} eq 'bridge') {
            foreach my $p (split (/\s+/, $d->{bridge_ports})) {
+               $p =~ s/\.\d+$//;
                my $n = $ifaces->{$p};
                die "bridge '$iface' - unable to find bridge port '$p'\n"
                    if !$n;
                my $n = $ifaces->{$p};
                die "bridge '$iface' - unable to find bridge port '$p'\n"
                    if !$n;