diff options
author | NOYB <Al_Stu@Frontier.com> | 2017-02-05 02:01:29 -0800 |
---|---|---|
committer | NOYB <Al_Stu@Frontier.com> | 2017-02-15 15:52:10 -0800 |
commit | 12516aad9a5f0d9f074b9a9fc6f817990b7abe0b (patch) | |
tree | 4fc182e8831b708fd44cac4dada5830ba2f74f3e /src/etc/inc/interfaces.inc | |
parent | 5fbc719be35ade666eb739f423831493358840a7 (diff) | |
download | pfsense-12516aad9a5f0d9f074b9a9fc6f817990b7abe0b.zip pfsense-12516aad9a5f0d9f074b9a9fc6f817990b7abe0b.tar.gz |
Vendor MAC Retention File Consolidate
Use a single file for vendor MAC retention (vendor_mac).
a) Writes only one file during boot up rather than a file for each interface.
b) More efficient than numerous tiny files.
c) Friendlier to write cycle sensitive media in a RAM disk disabled system.
Diffstat (limited to 'src/etc/inc/interfaces.inc')
-rw-r--r-- | src/etc/inc/interfaces.inc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 9b29bd0..90a5749 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -6005,12 +6005,10 @@ function get_interface_vendor_mac($interface) { global $g; $mac = ""; - $mac_file = "{$g['vardb_path']}/vendor_mac_($interface)"; + $mac_file = "{$g['vardb_path']}/vendor_mac"; if (file_exists($mac_file)) { - $mac = file_get_contents($mac_file); - if (!is_macaddr($mac)) { - $mac = ""; - } + $vendor_mac_arr = json_decode(file_get_contents($mac_file), true); + $mac = (is_macaddr($vendor_mac_arr[$interface])) ? $vendor_mac_arr[$interface] : ''; } return $mac; |