Commit b2f28859 authored by Franco Fichtner's avatar Franco Fichtner

system: partially merge cleanups from dec52fa6

parent 665b3c2d
...@@ -1773,19 +1773,18 @@ function system_console_configure() ...@@ -1773,19 +1773,18 @@ function system_console_configure()
function system_setup_sysctl() function system_setup_sysctl()
{ {
global $config;
activate_sysctls(); activate_sysctls();
if (isset($config['system']['sharednet'])) { system_arp_wrong_if();
system_disable_arp_wrong_if();
}
} }
function system_disable_arp_wrong_if() function system_arp_wrong_if()
{ {
set_sysctl(array( global $config;
"net.link.ether.inet.log_arp_wrong_iface" => "0",
"net.link.ether.inet.log_arp_movements" => "0" set_sysctl(array(
)); 'net.link.ether.inet.log_arp_wrong_iface' => isset($config['system']['sharednet']) ? '0' : '1',
'net.link.ether.inet.log_arp_movements' => isset($config['system']['sharednet']) ? '0' : '1',
));
} }
function get_possible_listen_ips($include_ipv6_link_local=false) { function get_possible_listen_ips($include_ipv6_link_local=false) {
......
...@@ -1357,12 +1357,12 @@ function get_alias_list($type = null) ...@@ -1357,12 +1357,12 @@ function get_alias_list($type = null)
return $result; return $result;
} }
/* Define what is preferred, IPv4 or IPv6 */ function prefer_ipv4_or_ipv6()
function prefer_ipv4_or_ipv6() { {
global $config; global $config;
if (isset($config['system']['prefer_ipv4'])) mwexecf(
mwexec("/etc/rc.d/ip6addrctl prefer_ipv4"); '/etc/rc.d/ip6addrctl %s',
else isset($config['system']['prefer_ipv4']) ? 'prefer_ipv4' : 'prefer_ipv6'
mwexec("/etc/rc.d/ip6addrctl prefer_ipv6"); );
} }
...@@ -117,18 +117,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -117,18 +117,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
if (count($input_errors) == 0) { if (count($input_errors) == 0) {
setup_polling();
if (isset($config['system']['sharednet'])) {
system_disable_arp_wrong_if();
} else {
// system_enable_arp_wrong_if
set_sysctl(array(
"net.link.ether.inet.log_arp_wrong_iface" => "1",
"net.link.ether.inet.log_arp_movements" => "1"
));
}
write_config(); write_config();
setup_polling();
system_arp_wrong_if();
prefer_ipv4_or_ipv6(); prefer_ipv4_or_ipv6();
filter_configure(); filter_configure();
header("Location: system_advanced_network.php"); header("Location: system_advanced_network.php");
...@@ -189,8 +180,8 @@ include("head.inc"); ...@@ -189,8 +180,8 @@ include("head.inc");
<td><a id="help_for_ipv6allow" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Allow IPv6"); ?></td> <td><a id="help_for_ipv6allow" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Allow IPv6"); ?></td>
<td> <td>
<input name="ipv6allow" type="checkbox" value="yes" <?= !empty($pconfig['ipv6allow']) ? "checked=\"checked\"" :"";?> onclick="enable_change(false)" /> <input name="ipv6allow" type="checkbox" value="yes" <?= !empty($pconfig['ipv6allow']) ? "checked=\"checked\"" :"";?> onclick="enable_change(false)" />
<strong><?=gettext("Allow IPv6"); ?></strong>
<div class="hidden" for="help_for_ipv6allow"> <div class="hidden" for="help_for_ipv6allow">
<strong><?=gettext("Allow IPv6"); ?></strong><br />
<?=gettext("All IPv6 traffic will be blocked by the firewall unless this box is checked."); ?><br /> <?=gettext("All IPv6 traffic will be blocked by the firewall unless this box is checked."); ?><br />
<?=gettext("NOTE: This does not disable any IPv6 features on the firewall, it only blocks traffic."); ?><br /> <?=gettext("NOTE: This does not disable any IPv6 features on the firewall, it only blocks traffic."); ?><br />
</div> </div>
...@@ -215,8 +206,8 @@ include("head.inc"); ...@@ -215,8 +206,8 @@ include("head.inc");
<td><a id="help_for_prefer_ipv4" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Prefer IPv4 over IPv6"); ?></td> <td><a id="help_for_prefer_ipv4" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Prefer IPv4 over IPv6"); ?></td>
<td> <td>
<input name="prefer_ipv4" type="checkbox" id="prefer_ipv4" value="yes" <?= !empty($config['system']['prefer_ipv4']) ? "checked=\"checked\"" : "";?> /> <input name="prefer_ipv4" type="checkbox" id="prefer_ipv4" value="yes" <?= !empty($config['system']['prefer_ipv4']) ? "checked=\"checked\"" : "";?> />
<strong><?=gettext("Prefer to use IPv4 even if IPv6 is available"); ?></strong>
<div class="hidden" for="help_for_prefer_ipv4"> <div class="hidden" for="help_for_prefer_ipv4">
<strong><?=gettext("Prefer to use IPv4 even if IPv6 is available"); ?></strong><br />
<?=gettext("By default, if a hostname resolves IPv6 and IPv4 addresses ". <?=gettext("By default, if a hostname resolves IPv6 and IPv4 addresses ".
"IPv6 will be used, if you check this option, IPv4 will be " . "IPv6 will be used, if you check this option, IPv4 will be " .
"used instead of IPv6."); ?> "used instead of IPv6."); ?>
......
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