---- Changes since 1.480 ----
Updated bonding support to use the new format in Debian 5.0, thanks to Caspar Smit.
---- Changes since 1.500 ----
-Added a field for editing the MAC address to apply at boot time on Redhat-based systems.
+Added a field for editing the MAC address to apply at boot time on Redhat and Debian-based systems.
elsif($param eq 'slaves') {
$cfg->{'partner'} = $value;
}
+ elsif($param eq 'hwaddr') {
+ local @v = split(/\s+/, $value);
+ $cfg->{'ether_type'} = $v[0];
+ $cfg->{'ether'} = $v[1];
+ }
else { $cfg->{$param} = $value; }
}
$cfg->{'dhcp'} = ($method eq 'dhcp');
my @autos = get_auto_defs();
my $amode = $gconfig{'os_version'} > 3 || scalar(@autos);
if (!$cfg->{'up'} && !$amode) { push(@options, ['noauto', '']); }
+if ($cfg->{'ether'}) {
+ push(@options, [ 'hwaddr', ($cfg->{'ether_type'} || 'ether').' '.
+ $cfg->{'ether'} ]);
+ }
# Set bonding parameters
if(($cfg->{'bond'} == 1) && ($gconfig{'os_version'} >= 5)) {
return $gconfig{'os_type'} eq 'debian-linux' && &has_command("vconfig");
}
+sub boot_iface_hardware
+{
+return $_[0] =~ /^eth/;
+}
+
1;
}
# Hardware address, if non-virtual
-if ((!$b && $in{'virtual'} eq "") ||
- ($b && $b->{'virtual'} eq "" &&
+if (($in{'new'} && $in{'virtual'} eq "") ||
+ (!$in{'new'} && $b->{'virtual'} eq "" &&
defined(&boot_iface_hardware) &&
&boot_iface_hardware($b->{'name'}))) {
$hardfield = &ui_opt_textbox("ether", $b->{'ether'}, 18,
$b->{'broadcast'} = $conf{'BROADCAST'};
$b->{'gateway'} = $conf{'GATEWAY'};
$b->{'mtu'} = $conf{'MTU'};
- $b->{'ether'} = $conf{'HWADDR'};
+ $b->{'ether'} = $conf{'MACADDR'};
$b->{'dhcp'} = ($conf{'BOOTPROTO'} eq 'dhcp');
$b->{'bootp'} = ($conf{'BOOTPROTO'} eq 'bootp');
$b->{'edit'} = ($b->{'name'} !~ /^ppp|irlan/);
delete($conf{'GATEWAY'});
}
$conf{'MTU'} = $_[0]->{'mtu'};
- $conf{'HWADDR'} = $_[0]->{'ether'};
+ $conf{'MACADDR'} = $_[0]->{'ether'};
$conf{'ONBOOT'} = $_[0]->{'up'} ? "yes" : "no";
$conf{'ONPARENT'} = $_[0]->{'up'} ? "yes" : "no"
if ($_[0]->{'virtual'} ne '');