summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-02 18:28:36 -0200
committerRenato Botelho <renato@netgate.com>2017-04-26 18:05:25 -0300
commitdeb15e0d35a5e16c53355ff20537e781f9538ab0 (patch)
tree79e5a0c10a20db7fb79a0f9815b09468109b6b87
parent9e721fea09dc252cd264bc2b67ef40a1d2d81e11 (diff)
downloadpfsense-deb15e0d35a5e16c53355ff20537e781f9538ab0.zip
pfsense-deb15e0d35a5e16c53355ff20537e781f9538ab0.tar.gz
Retain vendor MAC address for all interfaces during boot. Ticket #7011
-rwxr-xr-xsrc/etc/rc.bootup24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup
index d626520..0ade50d 100755
--- a/src/etc/rc.bootup
+++ b/src/etc/rc.bootup
@@ -186,6 +186,30 @@ 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();
+ unlink_if_exists("{$g['cf_conf_path']}/vendor_mac_*");
+ 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;
+ }
+
+ @file_put_contents("{$g['cf_conf_path']}/vendor_mac_{$if}",
+ $if_details['macaddr']);
+ }
+ unset($ifs, $if);
+ mwexec("/bin/kenv pfSense.boot=1");
+}
+
/* run any early shell commands specified in config.xml */
system_do_shell_commands(1);
OpenPOWER on IntegriCloud