diff options
author | Renato Botelho <renato@netgate.com> | 2017-05-19 12:13:52 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-05-19 12:13:52 -0300 |
commit | 8ce9725941732f11822121cfb4b51d19ed064533 (patch) | |
tree | 150ace45f89ed18f5fef4fd14c8fe73f7b02d966 /src/etc/inc/interfaces.inc | |
parent | ee8f5c6a4719aac90b9cd58371ceb7370fb50131 (diff) | |
download | pfsense-8ce9725941732f11822121cfb4b51d19ed064533.zip pfsense-8ce9725941732f11822121cfb4b51d19ed064533.tar.gz |
Use recently added hwaddr field to restore original MAC address
Diffstat (limited to 'src/etc/inc/interfaces.inc')
-rw-r--r-- | src/etc/inc/interfaces.inc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 248a9bb..5b375ec 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -6138,16 +6138,8 @@ function get_interface_mac($interface) { } function get_interface_vendor_mac($interface) { - global $g; - - $mac = ""; - $mac_file = "{$g['vardb_path']}/vendor_mac"; - if (file_exists($mac_file)) { - $vendor_mac_arr = json_decode(file_get_contents($mac_file), true); - $mac = (is_macaddr($vendor_mac_arr[$interface])) ? $vendor_mac_arr[$interface] : ''; - } - - return $mac; + $macinfo = pfSense_get_interface_addresses($interface); + return $macinfo["hwaddr"] ?: ''; } /****f* pfsense-utils/generate_random_mac_address |