summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-02 18:28:36 -0200
committerRenato Botelho <renato@netgate.com>2017-02-02 18:32:36 -0200
commit6ca93df3bd6255a025135ed45a303cd280773fdb (patch)
tree79a4d9ddb2cbdfd00fe4ee4137b7644e9b997750 /src
parentb17d47b67f73ed0cccc0edbdd9c9548522ba2e40 (diff)
downloadpfsense-6ca93df3bd6255a025135ed45a303cd280773fdb.zip
pfsense-6ca93df3bd6255a025135ed45a303cd280773fdb.tar.gz
Retain vendor MAC address for all interfaces during boot. Ticket #7011
Diffstat (limited to 'src')
-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 8fe9b16..e4a3a20 100755
--- a/src/etc/rc.bootup
+++ b/src/etc/rc.bootup
@@ -109,6 +109,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