]> git.proxmox.com Git - pve-common.git/commitdiff
inotify: read interfaces: avoid uninitialized value access
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 9 Mar 2020 10:28:21 +0000 (11:28 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 9 Mar 2020 10:28:38 +0000 (11:28 +0100)
check if 'ovs_type' is defined first

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/INotify.pm

index d0d9ba6c35b86103ced909d9de19f553afcdef72..391b9d21b65353b3a0f9a750e155a8e9ced46436 100644 (file)
@@ -1097,10 +1097,12 @@ sub __read_etc_network_interfaces {
        } else {
            if ($d->{'vxlan-id'}) {
                $d->{type} = 'vxlan';
        } else {
            if ($d->{'vxlan-id'}) {
                $d->{type} = 'vxlan';
-           } elsif ($d->{ovs_type} eq 'OVSIntPort') {
-               $d->{type} = $d->{ovs_type};
-               my $tag = &$extract_ovs_option($d, 'tag');
-               $d->{ovs_tag} = $tag if defined($tag);
+           } elsif (defined($d->{ovs_type})) {
+               if ($d->{ovs_type} eq 'OVSIntPort') {
+                   $d->{type} = $d->{ovs_type};
+                   my $tag = &$extract_ovs_option($d, 'tag');
+                   $d->{ovs_tag} = $tag if defined($tag);
+               }
            }
        }
 
            }
        }