diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network/connection/ethernet.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index 1818826..6d4d25b 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -185,10 +185,9 @@ sub check_address_settings { return 0; } #- test if IP address is already used - if (my $conflict = find_index { text2bool($_->{ONBOOT}) && $_->{DEVICE} ne $self->get_interface && $_->{IPADDR} eq $self->{address}{ip_address} } values %{$net->{ifcfg}} ) { + if (my $conflict = find { text2bool($_->{ONBOOT}) && $_->{DEVICE} ne $self->get_interface && $_->{IPADDR} eq $self->{address}{ip_address} } values %{$net->{ifcfg}} ) { # find out what connection we are conflicting with - my @conflicting_conn = values %{$net->{ifcfg}}; - my $conflict_device = @conflicting_conn[$conflict]->{DEVICE}; + my $conflict_device = $conflict->{DEVICE}; $self->{address}{error}{message} = N("%s is already used by connection that starts on boot (%s). To use this address with this connection, first disable all other devices which use it, or configure them not to start on boot", $self->{address}{ip_address}, $conflict_device); $self->{address}{error}{field} = \$self->{address}{ip_address}; |