Commit 811cf082 authored by Franco Fichtner's avatar Franco Fichtner

src: prune comments and correct misalignments

parent 77578606
...@@ -2812,10 +2812,7 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven ...@@ -2812,10 +2812,7 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) . mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) .
" link " . escapeshellarg($wancfg['spoofmac'])); " link " . escapeshellarg($wancfg['spoofmac']));
/* /* All vlans need to spoof their parent mac address, too. */
* All vlans need to spoof their parent mac address, too. see
* ticket #1514: http://cvstrac.pfsense.com/tktview?tn=1514,33
*/
if (isset($config['vlans']['vlan'])) { if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) { foreach ($config['vlans']['vlan'] as $vlan) {
if ($vlan['if'] == $realhwif) { if ($vlan['if'] == $realhwif) {
......
...@@ -42,12 +42,7 @@ function dump_rrd_to_xml($rrddatabase, $xmldumpfile) ...@@ -42,12 +42,7 @@ function dump_rrd_to_xml($rrddatabase, $xmldumpfile)
return($dumpret); return($dumpret);
} }
/* This xml 2 array function is courtesy of the php.net comment section on xml_parse. /* This xml 2 array function is courtesy of the php.net comment section on xml_parse. */
* it is roughly 4 times faster then our existing pfSense parser but due to the large
* size of the RRD xml dumps this is required.
* The reason we do not use it for pfSense is that it does not know about array fields
* which causes it to fail on array fields with single items. Possible Todo?
*/
function xml2array($contents, $get_attributes = 1, $priority = 'tag') function xml2array($contents, $get_attributes = 1, $priority = 'tag')
{ {
if (!function_exists('xml_parser_create')) if (!function_exists('xml_parser_create'))
......
...@@ -92,11 +92,6 @@ function relayd_configure($kill_first = false) ...@@ -92,11 +92,6 @@ function relayd_configure($kill_first = false)
$fd = fopen('/var/etc/relayd.conf', 'w'); $fd = fopen('/var/etc/relayd.conf', 'w');
$conf = "log updates \n"; $conf = "log updates \n";
/* Global timeout, interval and prefork settings
if not specified by the user:
- use a 1000 ms timeout value as in pfsense 2.0.1 and above
- leave interval and prefork empty, relayd will use its default values */
if (!empty($setting['timeout'])) { if (!empty($setting['timeout'])) {
$conf .= "timeout ".$setting['timeout']." \n"; $conf .= "timeout ".$setting['timeout']." \n";
} else { } else {
......
...@@ -115,7 +115,6 @@ function rrd_data_xml() { ...@@ -115,7 +115,6 @@ function rrd_data_xml() {
return $result; return $result;
} }
function restore_rrddata() { function restore_rrddata() {
global $config; global $config;
foreach($config['rrddata']['rrddatafile'] as $rrd) { foreach($config['rrddata']['rrddatafile'] as $rrd) {
...@@ -135,7 +134,7 @@ function restore_rrddata() { ...@@ -135,7 +134,7 @@ function restore_rrddata() {
} }
unlink($xml_file); unlink($xml_file);
} elseif (!empty($rrd['data'])) { } elseif (!empty($rrd['data'])) {
// pfSense 2.0 rrd backup format /* rrd backup format */
$rrd_file = "/var/db/rrd/{$rrd['filename']}"; $rrd_file = "/var/db/rrd/{$rrd['filename']}";
$rrd_fd = fopen($rrd_file, "w"); $rrd_fd = fopen($rrd_file, "w");
if (!$rrd_fd) { if (!$rrd_fd) {
...@@ -314,8 +313,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -314,8 +313,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (count($input_errors) == 0) { if (count($input_errors) == 0) {
if(stristr($data, "<m0n0wall>")) { if(stristr($data, "<m0n0wall>")) {
log_error('Upgrading m0n0wall configuration to OPNsense.'); log_error('Upgrading m0n0wall configuration to OPNsense.');
/* m0n0wall was found in config. convert it. */ $data = str_replace('m0n0wall', 'opnsense', $data);
$data = str_replace("m0n0wall", "pfsense", $data);
$m0n0wall_upgrade = true; $m0n0wall_upgrade = true;
} }
if (!empty($_POST['restorearea'])) { if (!empty($_POST['restorearea'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment