summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-06-01 08:18:39 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-06-01 08:18:39 +0000
commitf0a4c78ae91f151935dbe214a57260f1d52b4dd3 (patch)
treed5484246cbebc7abd472f98d2605fe955e25d4a4
parentc9072c6e25d5ef622ecb0fa9ed97b2296b729d63 (diff)
downloaddrakx-f0a4c78ae91f151935dbe214a57260f1d52b4dd3.tar
drakx-f0a4c78ae91f151935dbe214a57260f1d52b4dd3.tar.gz
drakx-f0a4c78ae91f151935dbe214a57260f1d52b4dd3.tar.bz2
drakx-f0a4c78ae91f151935dbe214a57260f1d52b4dd3.tar.xz
drakx-f0a4c78ae91f151935dbe214a57260f1d52b4dd3.zip
(getNet) handle interface w/o ip addresses
-rw-r--r--perl-install/detect_devices.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 0016e077b..97ae9eb66 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -493,7 +493,26 @@ sub getECI() {
grep { member(sprintf("%04x%04x%04x%04x", $_->{vendor}, $_->{id}, $_->{subvendor}, $_->{subid}), @ids) } usb_probe();
}
-sub getNet() { grep { $_ ne 'lo' } c::get_netdevices() }
+sub getNet() {
+ # we want LAN like interfaces here (eg: ath|br|eth|fddi|plip|tr|usb|wifi|wlan).
+ # there's also bnep%d for bluetooth, bcp%d...
+ # we do this by blacklisting the following interfaces:
+ # - sit0 which is *always* created by net/ipv6/sit.c, thus is always created since net.agent loads ipv6 module
+ # - ippp|isdn|plip|ppp (initscripts suggest that isdn%d can be created but kernel sources claim not)
+ # ippp%d are created by drivers/isdn/i4l/isdn_ppp.c
+ # plip%d are created by drivers/net/plip.c
+ # ppp%d are created by drivers/net/ppp_generic.c
+ #
+ # we need both detection schemes since:
+ # - 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)/ }
+ uniq(
+ (map { if_(/^\s*([A-Za-z0-9:\.]*):\s/, $1) } cat_("/proc/net/dev")),
+ c::get_netdevices(),
+ );
+ }
#sub getISDN() {
# mapgrep(sub {member (($_[0] =~ /\s*(\w*):/), @netdevices), $1 }, split(/\n/, cat_("/proc/net/dev")));