summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-03 08:35:13 -0200
committerRenato Botelho <renato@netgate.com>2017-02-03 08:35:21 -0200
commit67bc9afc96a32954c84d1b504085ac97dc5a14ef (patch)
tree87b44bb62fedd7ca208832be9e99c724a2cd418e /src
parentd1fe01d2df1fc443e4e9a474dfe6d2ec391f54ab (diff)
downloadpfsense-67bc9afc96a32954c84d1b504085ac97dc5a14ef.zip
pfsense-67bc9afc96a32954c84d1b504085ac97dc5a14ef.tar.gz
Simplify logic
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/interfaces.inc25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index cd2710f..67c2a04 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -3253,20 +3253,17 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
if ($wancfg['spoofmac'] && ($wancfg['spoofmac'] != $mac)) {
mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) .
" link " . escapeshellarg($wancfg['spoofmac']));
- } 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 %1$s has been automatically replaced with %2$s'), $realif, $random_mac), "Interfaces");
- }
+ } elseif ($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 %1$s has been automatically replaced with %2$s'), $realif, $random_mac), "Interfaces");
}
/* media */
OpenPOWER on IntegriCloud