diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 36df7d7ccf..0864391241 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -210,18 +210,19 @@ function interfaces_optional_configure_if($opti) { if ($optcfg['spoofmac']) { mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) . " link " . escapeshellarg($optcfg['spoofmac'])); - } else { - $mac = get_interface_mac_address($optcfg['if']); - 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. - */ - $random_mac = generate_random_mac_address(); - mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) . - " link " . escapeshellarg($random_mac)); - $optcfg['spoofmac'] = $random_mac; - write_config(); - file_notice("MAC Address altered", "The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface {$optcfg['if']} has been automatically replaced with {$random_mac}", "Interfaces"); + } else { + $mac = get_interface_mac_address($optcfg['if']); + 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. + */ + $random_mac = generate_random_mac_address(); + mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) . + " link " . escapeshellarg($random_mac)); + $optcfg['spoofmac'] = $random_mac; + write_config(); + file_notice("MAC Address altered", "The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface {$optcfg['if']} has been automatically replaced with {$random_mac}", "Interfaces"); + } } /* media */ @@ -949,4 +950,4 @@ function get_current_wan_address() { } } -?> +?> \ No newline at end of file