mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 11:20:30 +01:00
Support MAC address editing on Debian too
This commit is contained in:
@@ -53,4 +53,4 @@ On Debian systems, if the dns-nameservers option is defined in /etc/network/inte
|
||||
---- 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.
|
||||
|
||||
@@ -75,6 +75,11 @@ foreach $iface (@ifaces) {
|
||||
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');
|
||||
@@ -122,6 +127,10 @@ else {
|
||||
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)) {
|
||||
@@ -831,5 +840,10 @@ sub supports_vlans
|
||||
return $gconfig{'os_type'} eq 'debian-linux' && &has_command("vconfig");
|
||||
}
|
||||
|
||||
sub boot_iface_hardware
|
||||
{
|
||||
return $_[0] =~ /^eth/;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -203,8 +203,8 @@ if(($in{'vlan'}) or (&iface_type($b->{'name'}) =~ /^(.*) (VLAN)$/)) {
|
||||
}
|
||||
|
||||
# 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,
|
||||
|
||||
@@ -97,7 +97,7 @@ while($f = readdir(CONF)) {
|
||||
$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/);
|
||||
@@ -148,7 +148,7 @@ else {
|
||||
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 '');
|
||||
|
||||
Reference in New Issue
Block a user