]> git.proxmox.com Git - pve-container.git/commitdiff
fix uninitialized value warning
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 2 May 2016 13:41:13 +0000 (15:41 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 3 May 2016 05:01:58 +0000 (07:01 +0200)
src/PVE/LXC/Setup/Debian.pm

index 21bced5ef5fc2d4f83743ed7df5ca718284a9c1d..d803949e1355184889ac7ab8843252889249fa64 100644 (file)
@@ -196,7 +196,7 @@ sub setup_network {
        if ($section->{type} eq 'ipv4') {
            $done_v4_hash->{$ifname} = 1;
 
-           if ($net->{address} =~ /^(dhcp|manual)$/) {
+           if (defined($net->{address}) && $net->{address} =~ /^(dhcp|manual)$/) {
                $interfaces .= "iface $ifname inet $1\n";
            } else {
                $interfaces .= "iface $ifname inet static\n";
@@ -220,7 +220,7 @@ sub setup_network {
        } elsif ($section->{type} eq 'ipv6') {
            $done_v6_hash->{$ifname} = 1;
 
-           if ($net->{address6} =~ /^(auto|dhcp|manual)$/) {
+           if (defined($net->{address6}) && $net->{address6} =~ /^(auto|dhcp|manual)$/) {
                $interfaces .= "iface $ifname inet6 $1\n";
            } else {
                $interfaces .= "iface $ifname inet6 static\n";