summaryrefslogtreecommitdiffstats
path: root/perl-install/network/network.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network/network.pm')
-rw-r--r--perl-install/network/network.pm25
1 files changed, 14 insertions, 11 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 958690635..8b14a2fae 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -10,6 +10,7 @@ use Socket;
use common;
use detect_devices;
use run_program;
+use network::tools;
use any;
use vars qw(@ISA @EXPORT);
use log;
@@ -152,7 +153,7 @@ sub write_resolv_conf {
}
sub write_interface_conf {
- my ($file, $intf, $_netc, $prefix) = @_;
+ my ($file, $intf, $netc, $prefix) = @_;
if ($intf->{HWADDR} && -e "$prefix/sbin/ip") {
$intf->{HWADDR} = undef;
@@ -173,7 +174,12 @@ sub write_interface_conf {
$intf->{BOOTPROTO} =~ s/dhcp.*/dhcp/;
- setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR MII_NOT_SUPPORTED), if_($intf->{wireless_eth}, qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV)), if_($intf->{BOOTPROTO} eq "dhcp", qw(DHCP_HOSTNAME NEEDHOSTNAME)));
+ require network::ethernet;
+ my %cards = map { $_->[0] => $_->[1] } network::ethernet::conf_network_card_backend($netc, $intf);
+ setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR MII_NOT_SUPPORTED),
+ if_(is_wireless_intf($cards{$intf->{DEVICE}}), qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV)),
+ if_($intf->{BOOTPROTO} eq "dhcp", qw(DHCP_HOSTNAME NEEDHOSTNAME))
+ );
log::explanations("written $intf->{DEVICE} interface configuration in $file");
}
@@ -307,18 +313,12 @@ sub gateway {
my @masked = masked_ip($ip) =~ $ip_regexp;
$masked[3] = 1;
join(".", @masked);
-
}
sub configureNetworkIntf {
my ($netc, $in, $intf, $net_device, $skip, $module) = @_;
my $text;
- my @wireless_modules = qw(aironet_cs aironet4500_cs hermes airo orinoco_cs orinoco airo_cs netwave_cs ray_cs wavelan_cs wvlan_cs airport);
- my $flag = 0;
- foreach (@wireless_modules) {
- $module =~ /$_/ and $flag = 1;
- }
- if ($flag) {
+ if (is_wireless_intf($module)) {
$intf->{wireless_eth} = 1;
$netc->{wireless_eth} = 1;
$intf->{WIRELESS_MODE} = "Managed";
@@ -338,7 +338,10 @@ notation (for example, 1.2.3.4).");
my $auto_ip = $intf->{BOOTPROTO} !~ /static/;
my $onboot = $intf->{ONBOOT} ? $intf->{ONBOOT} =~ /yes/ : bool2yesno(!member($intf->{DEVICE}, map { $_->{device} } detect_devices::pcmcia_probe()));
my $needhostname = $intf->{NEEDHOSTNAME} !~ /no/;
- my $hotplug = $::isStandalone && !$intf->{MII_NOT_SUPPORTED} || 1;
+ # blacklist:
+ #$intf->{MII_NOT_SUPPORTED} ||= bool2yesno(member($module, qw(bcm4400))); # 3c59x de4x5 e100 e1000 ne2k-pci
+ my $hotplug = text2bool($intf->{MII_NOT_SUPPORTED});
+ invbool(\$hotplug);
my $track_network_id = $::isStandalone && $intf->{HWADDR} || detect_devices::isLaptop();
delete $intf->{NETWORK};
delete $intf->{BROADCAST};
@@ -479,7 +482,7 @@ sub read_all_conf {
add2hash($netc, read_resolv_conf());
add2hash($netc, read_tmdns_conf("$prefix/etc/tmdns.conf")) if -r "$prefix/etc/tmdns.conf";
foreach (all("$prefix/etc/sysconfig/network-scripts")) {
- if (/ifcfg-(\w+)/ && $1 ne 'lo') {
+ if (/^ifcfg-(\w+)/ && $1 ne 'lo') {
my $intf = findIntf($intf, $1);
add2hash($intf, { getVarsFromSh("$prefix/etc/sysconfig/network-scripts/$_") });
}