From e0ddbaab310e98ca4486d1f2ef053f12d46f53ed Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 17 Mar 2004 13:25:38 +0000 Subject: fix no information for drivers that do not support ethtool ioctl (eg: sk98lin): try to match the device by interface name and driver name (won't work for several cards managed by the same driver) --- perl-install/standalone/drakconnect | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 3e83aea79..b9fd3e765 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -203,7 +203,8 @@ sub manage { eval(cat_('/etc/sysconfig/drakconnect')); - my %name = network::ethernet::get_eth_cards_names(network::ethernet::get_eth_cards); + @all_cards = network::ethernet::get_eth_cards(); + my %name = network::ethernet::get_eth_cards_names(@all_cards); foreach (keys %name) { $p->{/eth|ath|wlan/ ? $name{$_} : $_} = { kind => $_ }; } @@ -541,6 +542,12 @@ sub build_notebook { if ($intf->{pages}{N("Information")}) { my ($info) = $gui->{description} ? find { $_->{description} eq $gui->{description} } detect_devices::probeall : network::ethernet::mapIntfToDevice($interface_kind); + if (is_empty_hash_ref($info) and my @intfs = grep { $interface_kind eq $_->[0] } @all_cards) { + my $driver; + if ($#intfs == 0 and $driver = $intfs[0][1] and my @cards = grep { $_->{driver} eq $driver } detect_devices::probeall()) { + $info = $cards[0] if $#cards == 0; + } + } gtkpack($gui->{sheet}{N("Information")} = Gtk2::VBox->new(0,0), gtktext_insert(Gtk2::TextView->new, @@ -577,6 +584,7 @@ sub save { foreach (keys %$p) { save_notebook($netc, $p->{$_}{intf}, $p->{$_}{gui}) or return; + print "will run apply()? ", $p->{$_}{intf}{save}, "\n"; $p->{$_}{intf}{save} ? $p->{$_}{intf}{save}->() : apply($netc, $p->{$_}{intf}); } @@ -696,6 +704,7 @@ sub update_list() { sub apply { my ($netc, $intf) = @_; + print "GOTCHA\n"; my $dyn = $intf->{BOOTPROTO} ne 'static'; my $lintf = $intf; $dyn and $lintf->{$_} = undef foreach qw(NETMASK NETWORK IPADDR); -- cgit v1.2.1