diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2009-06-25 14:55:09 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2009-06-25 14:55:09 +0000 |
commit | 5044be2b4f6bbfd0431c5344cbe16ace9a2f985d (patch) | |
tree | fea1736c2c14620eaab130f83251044df5613d80 | |
parent | cbafc21c0675e3fc7dc4f6c2b8cafe0935845152 (diff) | |
download | drakx-net-5044be2b4f6bbfd0431c5344cbe16ace9a2f985d.tar drakx-net-5044be2b4f6bbfd0431c5344cbe16ace9a2f985d.tar.gz drakx-net-5044be2b4f6bbfd0431c5344cbe16ace9a2f985d.tar.bz2 drakx-net-5044be2b4f6bbfd0431c5344cbe16ace9a2f985d.tar.xz drakx-net-5044be2b4f6bbfd0431c5344cbe16ace9a2f985d.zip |
Show what device we are conflicting with for duplicate addresses.
-rw-r--r-- | lib/network/connection/ethernet.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index c7a76ea..1818826 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -185,8 +185,12 @@ sub check_address_settings { return 0; } #- test if IP address is already used - if (find { text2bool($_->{ONBOOT}) && $_->{DEVICE} ne $self->get_interface && $_->{IPADDR} eq $self->{address}{ip_address} } values %{$net->{ifcfg}}) { - $self->{address}{error}{message} = N("%s is already used by connection that starts on boot. 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}); + if (my $conflict = find_index { 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}; + + $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}; return 0; } |