From 0181426813c25b0c06463cb7075ef5dc632e4364 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 4 Mar 2005 11:10:12 +0000 Subject: add is_lan_interface --- perl-install/detect_devices.pm | 8 ++++++-- 1 file 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(), -- cgit v1.2.1