Commit 6369d1b9 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

lets not try to hide issues with a NIC, 11 year old code.

(cherry picked from commit 0db74eff)
parent 1c37911d
...@@ -2764,19 +2764,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven ...@@ -2764,19 +2764,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
} }
} }
} }
} else {
if ($mac == "ff:ff:ff:ff:ff:ff") {
/* this is not a valid mac address. generate a
* temporary mac address so the machine can get online.
*/
echo gettext("Generating new MAC address.");
$random_mac = generate_random_mac_address();
mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) .
" link " . escapeshellarg($random_mac));
$wancfg['spoofmac'] = $random_mac;
write_config();
file_notice("MAC Address altered", sprintf(gettext('The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface %s has been automatically replaced with %s'), $realif, $random_mac), "Interfaces");
}
} }
/* media */ /* media */
...@@ -4684,23 +4671,6 @@ function get_interface_mac($interface) ...@@ -4684,23 +4671,6 @@ function get_interface_mac($interface)
return $macinfo["macaddr"]; return $macinfo["macaddr"];
} }
/****f* legacy/generate_random_mac_address
* NAME
* generate_random_mac - generates a random mac address
* INPUTS
* none
* RESULT
* $mac - a random mac address
******/
function generate_random_mac_address()
{
$mac = "02";
for ($x=0; $x<5; $x++) {
$mac .= ":" . dechex(rand(16, 255));
}
return $mac;
}
/****f* interfaces/is_jumbo_capable /****f* interfaces/is_jumbo_capable
* NAME * NAME
* is_jumbo_capable - Test if interface is jumbo frame capable. Useful for determining VLAN capability. * is_jumbo_capable - Test if interface is jumbo frame capable. Useful for determining VLAN capability.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment