summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2003-02-03 15:43:42 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2003-02-03 15:43:42 +0000
commita1957d01dda0bb9e23dbe8e756438d4a197d64a5 (patch)
tree6afd2013d58852858a473a315446a0d53a1c3c01 /perl-install/network
parenta40c638482affd6842b23e23bf4d0c9cd5debca2 (diff)
downloaddrakx-a1957d01dda0bb9e23dbe8e756438d4a197d64a5.tar
drakx-a1957d01dda0bb9e23dbe8e756438d4a197d64a5.tar.gz
drakx-a1957d01dda0bb9e23dbe8e756438d4a197d64a5.tar.bz2
drakx-a1957d01dda0bb9e23dbe8e756438d4a197d64a5.tar.xz
drakx-a1957d01dda0bb9e23dbe8e756438d4a197d64a5.zip
dhcp/zeroconf stuff
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/network.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index ae341e926..88148dc38 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -139,17 +139,23 @@ sub write_interface_conf {
my @ip = split '\.', $intf->{IPADDR};
my @mask = split '\.', $intf->{NETMASK};
- $netc->{DHCP} ? ($intf->{DHCP_HOSTNAME} = $netc->{HOSTNAME}) : add2hash($intf, { NEEDHOSTNAME => "yes" });
-
+ if ($netc->{DHCP} && $netc->{HOSTNAME}) {
+ $intf->{DHCP_HOSTNAME} = $netc->{HOSTNAME};
+ $intf->{NEEDHOSTNAME} = "no";
+ } else {
+ $intf->{DHCP_HOSTNAME} = "";
+ $intf->{NEEDHOSTNAME} = "yes"
+ }
+
add2hash($intf, {
BROADCAST => join('.', mapn { int($_[0]) | ((~int($_[1])) & 255) } \@ip, \@mask),
NETWORK => join('.', mapn { int($_[0]) & $_[1] } \@ip, \@mask),
ONBOOT => bool2yesno(!member($intf->{DEVICE}, map { $_->{device} } detect_devices::probeall())),
});
-
+
$intf->{BOOTPROTO} =~ s/dhcp.*/dhcp/; #- TODO: avoid obfuscating BOOTPROTO, waiting for zeroconf conf details
- setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR), 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_($netc->{DHCP}, 'DHCP_HOSTNAME'), if_(!$netc->{DHCP}, 'NEEDHOSTNAME'));
+ setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR), 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->{DHCP_HOSTNAME}, 'DHCP_HOSTNAME'), if_(!$intf->{DHCP_HOSTNAME}, 'NEEDHOSTNAME'));
}
sub add2hosts {
@@ -335,6 +341,7 @@ notation (for example, 1.2.3.4).");
$intf->{BOOTPROTO} = $auto_ip ? join('', if_($auto_ip, "dhcp") , if_($zeroconf, "zeroconf")) : "static";
$netc->{DHCP} = $auto_ip;
$netc->{ZEROCONF} = $zeroconf if $auto_ip;
+ return 0 if $auto_ip;
if (my @bad = map_index { if_(!is_ip($intf->{$_}), $::i) } @fields) {
$in->ask_warn('', N("IP address should be in format 1.2.3.4"));