diff options
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/interfaces.inc | 12 | ||||
-rwxr-xr-x | src/etc/rc.bootup | 27 |
2 files changed, 3 insertions, 36 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 diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup index bfc555e..8924efe 100755 --- a/src/etc/rc.bootup +++ b/src/etc/rc.bootup @@ -109,32 +109,7 @@ echo "Loading configuration..."; parse_config_bootup(); echo "done.\n"; -/* If pfSense.boot kenv is set, it's a reroot */ -if (mwexec("/bin/kenv -q pfSense.boot 2>/dev/null") != 0) { - /* Collect vendor MAC address for all interfaces */ - $ifs = pfSense_interface_listget(); - foreach ($ifs as $if) { - $if_details = pfSense_get_interface_addresses($if); - if (isset($if_details['iftype']) && - $if_details['iftype'] == 'virtual') { - continue; - } - - if (empty($if_details['macaddr']) || - $if_details['macaddr'] == "00:00:00:00:00:00") { - continue; - } - - $vendor_mac_arr[$if] = $if_details['macaddr']; - } - $vendor_mac_arr_json = json_encode($vendor_mac_arr); - if (@file_get_contents("{$g['vardb_path']}/vendor_mac") !== $vendor_mac_arr_json) { - @file_put_contents("{$g['vardb_path']}/vendor_mac", $vendor_mac_arr_json); - } - unset($ifs, $if, $vendor_mac_arr, $vendor_mac_arr_json); - mwexec("/usr/sbin/gnid > {$g['vardb_path']}/uniqueid 2>/dev/null"); - mwexec("/bin/kenv pfSense.boot=1"); -} +mwexec("/usr/sbin/gnid > {$g['vardb_path']}/uniqueid 2>/dev/null"); /* run any early shell commands specified in config.xml */ system_do_shell_commands(1); |