diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-03-05 20:25:45 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-03-05 20:25:45 +0000 |
commit | 597396c0f036a9cf423f2cbf7ef17bbb89ded242 (patch) | |
tree | e4ec4bea899ea7fbdeaf7efa3c47fdf9ca858c0c /lib | |
parent | e1f65769589d7ab4fcf04b6ffbec08f1ffe27ce6 (diff) | |
download | drakx-net-597396c0f036a9cf423f2cbf7ef17bbb89ded242.tar drakx-net-597396c0f036a9cf423f2cbf7ef17bbb89ded242.tar.gz drakx-net-597396c0f036a9cf423f2cbf7ef17bbb89ded242.tar.bz2 drakx-net-597396c0f036a9cf423f2cbf7ef17bbb89ded242.tar.xz drakx-net-597396c0f036a9cf423f2cbf7ef17bbb89ded242.zip |
improve support for virtual interfaces
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network/connection/ethernet.pm | 5 | ||||
-rw-r--r-- | lib/network/tools.pm | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index c99f805..1381f1a 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -22,7 +22,10 @@ sub get_devices() { sub get_unlisted_devices { my ($interfaces, $listed_devices) = @_; my @unlisted_interfaces = sort(difference2($interfaces, [ map { device_to_interface($_) } @$listed_devices ])); - map { interface_to_device($_) || +{ description => $_, interface => $_ } } @unlisted_interfaces; + map { interface_to_device($_) || +{ + description => $_ =~ /:\d+$/ ? N("Virtual interface") : $_, + interface => $_ }, + } @unlisted_interfaces; } sub handles_ifcfg { diff --git a/lib/network/tools.pm b/lib/network/tools.pm index a65fd7c..0db6b26 100644 --- a/lib/network/tools.pm +++ b/lib/network/tools.pm @@ -160,6 +160,7 @@ sub get_default_gateway_interface { sub get_interface_status { my ($intf) = @_; + $intf =~ s/:\d+$//; my $routes = get_routes(); return $routes->{$intf}{network}, $routes->{$intf}{network} eq '0.0.0.0' && $routes->{$intf}{gateway}; } |