[pve-devel] [PATCH v2 06/11] read_etc_interfaces: missing iface initialization

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Jun 25 11:54:29 CEST 2015


If no 'auto' line was read the interface hash has to be
initialized.
---
 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 630e62f..7fc6978 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -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 $d = $ifaces->{$i};
+	    my $d = $ifaces->{$i} ||= {};
 	    $d->{priority} = $priority++ if !$d->{priority};
 	    push @{$d->{families}}, $family;
 
-- 
2.1.4





More information about the pve-devel mailing list