diff options
author | NOYB <Al_Stu@Frontier.com> | 2017-02-05 01:41:00 -0800 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-04-26 18:06:26 -0300 |
commit | d9c3f61aad8fd72044660864fc35aac821dd32c7 (patch) | |
tree | 1e9d6bd6447470a99a704c3624421243417a22f1 | |
parent | f2a19d77746f1160ecb87059f87c92ebda137ff1 (diff) | |
download | pfsense-d9c3f61aad8fd72044660864fc35aac821dd32c7.zip pfsense-d9c3f61aad8fd72044660864fc35aac821dd32c7.tar.gz |
Vendor MAC Restore Logic
Only use the vendor MAC retention file for restoring the vendor MAC when not booting.
a) During boot up the current MAC that is obtained from the system is the vendor MAC.
b) Using this eliminates the inefficient need to open the vendor MAC retention file for every interface during system boot up.
-rw-r--r-- | src/etc/inc/interfaces.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index ec0dee9..a5e2fdc 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -3264,8 +3264,13 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven interface_wireless_configure($realif, $wancfg, $wancfg['wireless']); } + /* Get the vendor MAC. Use source dependent upon whether or not booting. */ $current_mac = get_interface_mac($realhwif); - $vendor_mac = get_interface_vendor_mac($realhwif); + if (platform_booting()) { + $vendor_mac = $current_mac; + } else { + $vendor_mac = get_interface_vendor_mac($realhwif); + } $mac_addr = $wancfg['spoofmac'] ?: $vendor_mac; /* * Don't try to reapply the MAC if it's already applied. |