summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/interfaces.inc
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:13 -0200
commit77890d7d47e6d759a4b614a5564dbe6aeb7df91c (patch)
tree6ed82cd86fcd414d3a7d48d4449af0916d1372f6 /src/etc/inc/interfaces.inc
parentbc8eedaa4eee360fabaf8de375cd55d4506fee7d (diff)
downloadpfsense-77890d7d47e6d759a4b614a5564dbe6aeb7df91c.zip
pfsense-77890d7d47e6d759a4b614a5564dbe6aeb7df91c.tar.gz
Simplify logic
Diffstat (limited to 'src/etc/inc/interfaces.inc')
-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 c5bed0d..7310e13 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -3282,20 +3282,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