]> git.proxmox.com Git - pve-common.git/commitdiff
read_etc_interfaces: missing iface initialization
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 25 Jun 2015 09:54:29 +0000 (11:54 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 26 Jun 2015 05:46:30 +0000 (07:46 +0200)
If no 'auto' line was read the interface hash has to be
initialized.

src/PVE/INotify.pm

index 630e62f2f1afe3812d625a4b4c3f4abb68f162a3..7fc6978cfdb4beeaa555d9aa89579c53e31dc73f 100644 (file)
@@ -827,7 +827,7 @@ sub __read_etc_network_interfaces {
            my $f = { method => $3 }; # by family, merged to $d with a $suffix
            (my $suffix = $family) =~ s/^inet//;
 
            my $f = { method => $3 }; # by family, merged to $d with a $suffix
            (my $suffix = $family) =~ s/^inet//;
 
-           my $d = $ifaces->{$i};
+           my $d = $ifaces->{$i} ||= {};
            $d->{priority} = $priority++ if !$d->{priority};
            push @{$d->{families}}, $family;
 
            $d->{priority} = $priority++ if !$d->{priority};
            push @{$d->{families}}, $family;