[pve-devel] [PATCH v5 pve-common 4/5] INotify: check duplicate interface name by family

Alexandre Derumier aderumier at odiso.com
Wed Apr 3 15:39:19 CEST 2019


---
 src/PVE/INotify.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 0dae177..70c34b1 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -914,6 +914,10 @@ sub __read_etc_network_interfaces {
 	    my $f = { method => $3 }; # by family, merged to $d with a $suffix
 	    (my $suffix = $family) =~ s/^inet//;
 
+	    foreach my $existing_family (@{$ifaces->{$i}->{'families'}}) {
+		die "interface $i with family $family already exist" if $family eq $existing_family;
+	    }
+
 	    my $d = $ifaces->{$i} ||= {};
 	    $d->{priority} = $priority++ if !$d->{priority};
 	    push @{$d->{families}}, $family;
-- 
2.11.0




More information about the pve-devel mailing list