inotify: read interfaces: avoid uninitialized value access

check if 'ovs_type' is defined first

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-03-09 11:28:21 +01:00
parent 4566729d4e
commit d2513a84df

View File

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