summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-03-04 11:10:12 +0000
committerOlivier Blin <oblin@mandriva.org>2005-03-04 11:10:12 +0000
commit0181426813c25b0c06463cb7075ef5dc632e4364 (patch)
treeb4289afe176ca6b66d474114a587b65f3a26785f
parent42e9732db1c92d54f8511b1834c1a2e261c1fdfa (diff)
downloaddrakx-0181426813c25b0c06463cb7075ef5dc632e4364.tar
drakx-0181426813c25b0c06463cb7075ef5dc632e4364.tar.gz
drakx-0181426813c25b0c06463cb7075ef5dc632e4364.tar.bz2
drakx-0181426813c25b0c06463cb7075ef5dc632e4364.tar.xz
drakx-0181426813c25b0c06463cb7075ef5dc632e4364.zip
add is_lan_interface
-rw-r--r--perl-install/detect_devices.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index c9a48460d..1f376aeb1 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -549,7 +549,7 @@ sub getECI() {
grep { member(sprintf("%04x%04x%04x%04x", $_->{vendor}, $_->{id}, $_->{subvendor}, $_->{subid}), @ids) } usb_probe();
}
-sub getNet() {
+sub is_lan_interface {
# we want LAN like interfaces here (eg: ath|br|eth|fddi|plip|ra|tr|usb|wifi|wlan).
# there's also bnep%d for bluetooth, bcp%d...
# we do this by blacklisting the following interfaces:
@@ -563,7 +563,11 @@ sub getNet() {
# - get_netdevices() use the SIOCGIFCONF ioctl that does not list interfaces that are down
# - /proc/net/dev does not list VLAN and IP aliased interfaces
- grep { !/^(?:lo|ippp|isdn|plip|ppp|sit0)/ }
+ $_[0] !~ /^(?:lo|ippp|isdn|plip|ppp|sit0)/;
+}
+
+sub getNet() {
+ grep { is_lan_interface($_) }
uniq(
(map { if_(/^\s*([A-Za-z0-9:\.]*):/, $1) } cat_("/proc/net/dev")),
c::get_netdevices(),