From f2a19d77746f1160ecb87059f87c92ebda137ff1 Mon Sep 17 00:00:00 2001 From: NOYB Date: Sun, 5 Feb 2017 01:33:54 -0800 Subject: Spoof MAC Var Name Rename 'spoof_mac' var to generic 'mac_addr'. a) It may be the vendor MAC or a spoofed MAC. b) Update the comment re: not reapplying an already applied MAC. --- src/etc/inc/interfaces.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index db011cf..ec0dee9 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -3266,16 +3266,16 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven $current_mac = get_interface_mac($realhwif); $vendor_mac = get_interface_vendor_mac($realhwif); - $spoof_mac = $wancfg['spoofmac'] ?: $vendor_mac; + $mac_addr = $wancfg['spoofmac'] ?: $vendor_mac; /* - * Don't try to reapply the spoofed MAC if it's already applied. + * Don't try to reapply the MAC if it's already applied. * When ifconfig link is used, it cycles the interface down/up, which triggers - * the interface config again, which attempts to spoof the MAC again, + * the interface config again, which attempts to apply the MAC again, * which cycles the link again... */ - if (!empty($spoof_mac) && ($spoof_mac != $current_mac)) { + if (!empty($mac_addr) && ($mac_addr != $current_mac)) { mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) . - " link " . escapeshellarg($spoof_mac)); + " link " . escapeshellarg($mac_addr)); } elseif ($current_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. -- cgit v1.1