Commit 1eb5dae7 authored by Franco Fichtner's avatar Franco Fichtner

www: zap some spurious assigments

Most of the time, there is no return value from the functions,
sometimes $retval is not evaluated, and sometimes it just seems
totally convoluted to do it when 99% of the configuration code
does not do it and works fine wihout it.

It's also not practical, because there is no no notion of a
rollback that would have to ensue in such cases.
parent 05bf8947
...@@ -172,13 +172,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -172,13 +172,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
$retval = 0; system_syslogd_start();
$retval = system_syslogd_start();
if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock']))
|| ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) || ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass']))
|| ($oldnologbogons !== isset($config['syslog']['nologbogons'])) || ($oldnologbogons !== isset($config['syslog']['nologbogons']))
|| ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) || ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) {
$retval |= filter_configure(); filter_configure();
}
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
......
...@@ -43,10 +43,8 @@ if ($_POST) { ...@@ -43,10 +43,8 @@ if ($_POST) {
$pconfig = $_POST; $pconfig = $_POST;
if ($_POST['apply']) { if ($_POST['apply']) {
$retval = 0; relayd_configure();
$retval |= relayd_configure(); filter_configure();
$retval |= filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
clear_subsystem_dirty('loadbalancer'); clear_subsystem_dirty('loadbalancer');
} }
......
...@@ -44,10 +44,8 @@ if ($_POST) { ...@@ -44,10 +44,8 @@ if ($_POST) {
$pconfig = $_POST; $pconfig = $_POST;
if ($_POST['apply']) { if ($_POST['apply']) {
$retval = 0; relayd_configure();
$retval |= relayd_configure(); filter_configure();
$retval |= filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
clear_subsystem_dirty('loadbalancer'); clear_subsystem_dirty('loadbalancer');
} }
......
...@@ -40,12 +40,9 @@ if (!is_array($config['load_balancer']['setting'])) { ...@@ -40,12 +40,9 @@ if (!is_array($config['load_balancer']['setting'])) {
$lbsetting = &$config['load_balancer']['setting']; $lbsetting = &$config['load_balancer']['setting'];
if ($_POST) { if ($_POST) {
if ($_POST['apply']) { if ($_POST['apply']) {
$retval = 0; relayd_configure();
$retval |= relayd_configure(); filter_configure();
$retval |= filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
clear_subsystem_dirty('loadbalancer'); clear_subsystem_dirty('loadbalancer');
} else { } else {
......
...@@ -82,9 +82,8 @@ if ($_POST) { ...@@ -82,9 +82,8 @@ if ($_POST) {
$pconfig = $_POST; $pconfig = $_POST;
if ($_POST['apply']) { if ($_POST['apply']) {
$retval = 0; relayd_configure();
$retval |= relayd_configure(); filter_configure();
$retval |= filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
/* Wipe out old relayd anchors no longer in use. */ /* Wipe out old relayd anchors no longer in use. */
cleanup_lb_marked(); cleanup_lb_marked();
......
...@@ -61,9 +61,8 @@ $relay_hosts = get_lb_summary(); ...@@ -61,9 +61,8 @@ $relay_hosts = get_lb_summary();
if ($_POST) { if ($_POST) {
if ($_POST['apply']) { if ($_POST['apply']) {
$retval = 0; relayd_configure();
$retval |= filter_configure(); filter_configure();
$retval |= relayd_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
clear_subsystem_dirty('loadbalancer'); clear_subsystem_dirty('loadbalancer');
} else { } else {
......
...@@ -216,13 +216,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -216,13 +216,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
killbypid('/var/run/filterdns.pid'); killbypid('/var/run/filterdns.pid');
} }
$retval = 0; $savemsg = get_std_save_message();
$retval = filter_configure();
if (stristr($retval, "error") <> true) { filter_configure();
$savemsg = get_std_save_message();
} else {
$savemsg = $retval;
}
} }
} }
......
...@@ -94,14 +94,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -94,14 +94,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
@unlink('/tmp/.system_routes.apply'); @unlink('/tmp/.system_routes.apply');
} }
$retval = system_routing_configure(); system_routing_configure();
$retval |= filter_configure(); filter_configure();
/* reconfigure our gateway monitor */
setup_gateways_monitor(); setup_gateways_monitor();
clear_subsystem_dirty('staticroutes');
if ($retval == 0) {
clear_subsystem_dirty('staticroutes');
}
} elseif (isset($id) && $act == 'del') { } elseif (isset($id) && $act == 'del') {
delete_static_route($id); delete_static_route($id);
unset($a_routes[$id]); unset($a_routes[$id]);
......
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