Commit dec52fa6 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: prune some settings while investigating #832

o polling is going away
o idiomaitic way to enable/disable arp handling
o where does ip version prefer really fit in?
o unhide checkbox captions, as redundant as they may seem
parent 6b18b3ec
......@@ -231,13 +231,12 @@ function configure_interface_hardware($ifs)
{
global $config;
$intf_details = legacy_interface_details($ifs);
/* skip vlans for checksumming and polling */
/* skip vlans for checksumming */
if (!stristr($ifs, "_vlan") && is_array($intf_details)) {
// get current settings
$csum_set = in_array('rxcsum', $intf_details['options']) || in_array('txcsum', $intf_details['options']);
$tso_set = in_array('tso4', $intf_details['options']) || in_array('tso6', $intf_details['options']);
$lro_set = in_array('lro', $intf_details['options']);
$polling_set = in_array('polling', $intf_details['options']);
// hardware checksum offloading offloading
if (isset($config['system']['disablechecksumoffloading']) && $csum_set) {
......@@ -258,12 +257,5 @@ function configure_interface_hardware($ifs)
} elseif (!isset($config['system']['disablelargereceiveoffloading']) && !$lro_set) {
legacy_interface_flags($ifs, 'lro', false);
}
// polling
if (isset($config['system']['polling']) && !$polling_set) {
legacy_interface_flags($ifs, 'polling', false);
} elseif (!isset($config['system']['polling']) && $polling_set) {
legacy_interface_flags($ifs, '-polling', false);
}
}
}
......@@ -71,29 +71,6 @@ function get_dns_servers() {
return array_unique($dns_servers);
}
/****f* legacy/setup_polling
* NAME
* sets up polling
* INPUTS
*
* RESULT
* null
* NOTES
*
******/
function setup_polling()
{
global $config;
if (isset($config['system']['polling'])) {
set_single_sysctl("kern.polling.idle_poll", "1");
} else {
set_single_sysctl("kern.polling.idle_poll", "0");
}
}
/*
* get_carp_interface_status($carpinterface): returns the status of a carp ip
*/
......
......@@ -1773,18 +1773,17 @@ function system_console_configure()
function system_setup_sysctl()
{
global $config;
activate_sysctls();
if (isset($config['system']['sharednet'])) {
system_disable_arp_wrong_if();
}
system_arp_wrong_if();
}
function system_disable_arp_wrong_if()
function system_arp_wrong_if()
{
global $config;
set_sysctl(array(
"net.link.ether.inet.log_arp_wrong_iface" => "0",
"net.link.ether.inet.log_arp_movements" => "0"
'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',
));
}
......
......@@ -1357,12 +1357,12 @@ function get_alias_list($type = null)
return $result;
}
/* Define what is preferred, IPv4 or IPv6 */
function prefer_ipv4_or_ipv6() {
function prefer_ipv4_or_ipv6()
{
global $config;
if (isset($config['system']['prefer_ipv4']))
mwexec("/etc/rc.d/ip6addrctl prefer_ipv4");
else
mwexec("/etc/rc.d/ip6addrctl prefer_ipv6");
mwexecf(
'/etc/rc.d/ip6addrctl %s',
isset($config['system']['prefer_ipv4']) ? 'prefer_ipv4' : 'prefer_ipv6'
);
}
......@@ -228,11 +228,6 @@ echo "Starting Secure Shell Services...";
mwexec("/usr/local/etc/rc.sshd");
echo "done.\n";
/* setup polling */
echo "Setting up polling defaults...";
setup_polling();
echo "done.\n";
/* set up interfaces */
mute_kernel_msgs();
interfaces_configure();
......
......@@ -42,7 +42,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
$pconfig['ipv6nat_ipaddr'] = isset($config['diag']['ipv6nat']['ipaddr']) ? $config['diag']['ipv6nat']['ipaddr']:"" ;
$pconfig['prefer_ipv4'] = isset($config['system']['prefer_ipv4']);
$pconfig['polling'] = isset($config['system']['polling']);
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
$pconfig['disablesegmentationoffloading'] = isset($config['system']['disablesegmentationoffloading']);
$pconfig['disablelargereceiveoffloading'] = isset($config['system']['disablelargereceiveoffloading']);
......@@ -86,12 +85,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($config['system']['sharednet']);
}
if (!empty($pconfig['polling'])) {
$config['system']['polling'] = true;
} elseif (isset($config['system']['polling'])) {
unset($config['system']['polling']);
}
if (!empty($pconfig['disablechecksumoffloading'])) {
$config['system']['disablechecksumoffloading'] = true;
} elseif (isset($config['system']['disablechecksumoffloading'])) {
......@@ -117,18 +110,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
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();
system_arp_wrong_if();
prefer_ipv4_or_ipv6();
filter_configure();
header("Location: system_advanced_network.php");
......@@ -189,8 +172,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>
<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">
<strong><?=gettext("Allow IPv6"); ?></strong><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 />
</div>
......@@ -215,8 +198,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>
<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">
<strong><?=gettext("Prefer to use IPv4 even if IPv6 is available"); ?></strong><br />
<?=gettext("By default, if a hostname resolves IPv6 and IPv4 addresses ".
"IPv6 will be used, if you check this option, IPv4 will be " .
"used instead of IPv6."); ?>
......@@ -226,19 +209,6 @@ include("head.inc");
<tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Network Interfaces"); ?></th>
</tr>
<tr>
<td><a id="help_for_polling" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Device polling"); ?></td>
<td>
<input name="polling" type="checkbox" id="polling_enable" value="yes" <?= !empty($pconfig['polling']) ? "checked=\"checked\"" :"";?> />
<strong><?=gettext("Enable device polling"); ?></strong>
<div class="hidden" for="help_for_polling">
<?php printf(gettext("Device polling is a technique that lets the system periodically poll network devices for new data instead of relying on interrupts. This prevents your webConfigurator, SSH, etc. from being inaccessible due to interrupt floods when under extreme load. Generally this is not recommended. Not all NICs support polling; see the %s homepage for a list of supported cards."), $g['product_name']); ?>
<br />
<span class="text-warning"><strong><?=gettext("Note:");?>&nbsp;</strong></span>
<?=gettext("This will take effect after you reboot the machine or re-configure each interface.");?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_disablechecksumoffloading" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hardware CRC"); ?></td>
<td>
......
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