Commit ead192f9 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) make disablevlanhwfilter optional + redirect on successful save in...

(legacy) make disablevlanhwfilter optional + redirect on successful save in system_advanced_network.php

(cherry picked from commit 2fc3baa9)
parent 8de177f3
...@@ -280,13 +280,16 @@ function interface_vlan_configure(&$vlan) ...@@ -280,13 +280,16 @@ function interface_vlan_configure(&$vlan)
} }
} }
foreach ($members as $member) { // disable/enable hardware vlan tags, will be skipped when "Leave default" (option 2) is selected
// set one tag at a time to avoid driver issues if (!isset($config['system']['disablevlanhwfilter']) || $config['system']['disablevlanhwfilter'] == 1) {
foreach (array('vlanmtu', 'vlanhwtag', 'vlanhwfilter', 'vlanhwcsum', 'vlanhwtso') as $tag) { foreach ($members as $member) {
if (!isset($config['system']['disablevlanhwfilter'])) { // set one tag at a time to avoid driver issues
legacy_interface_flags($member, $tag); foreach (array('vlanmtu', 'vlanhwtag', 'vlanhwfilter', 'vlanhwcsum', 'vlanhwtso') as $tag) {
} else { if (!isset($config['system']['disablevlanhwfilter'])) {
legacy_interface_flags($member, '-'.$tag); legacy_interface_flags($member, $tag);
} else {
legacy_interface_flags($member, '-'.$tag);
}
} }
} }
} }
......
...@@ -46,7 +46,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -46,7 +46,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']); $pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
$pconfig['disablesegmentationoffloading'] = isset($config['system']['disablesegmentationoffloading']); $pconfig['disablesegmentationoffloading'] = isset($config['system']['disablesegmentationoffloading']);
$pconfig['disablelargereceiveoffloading'] = isset($config['system']['disablelargereceiveoffloading']); $pconfig['disablelargereceiveoffloading'] = isset($config['system']['disablelargereceiveoffloading']);
$pconfig['disablevlanhwfilter'] = isset($config['system']['disablevlanhwfilter']); if (!isset($config['system']['disablevlanhwfilter'])) {
$pconfig['disablevlanhwfilter'] = "0";
} else {
$pconfig['disablevlanhwfilter'] = $config['system']['disablevlanhwfilter'];
}
$pconfig['sharednet'] = isset($config['system']['sharednet']); $pconfig['sharednet'] = isset($config['system']['sharednet']);
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
$pconfig = $_POST; $pconfig = $_POST;
...@@ -107,13 +111,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -107,13 +111,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
if (!empty($_POST['disablevlanhwfilter'])) { if (!empty($_POST['disablevlanhwfilter'])) {
$config['system']['disablevlanhwfilter'] = true; $config['system']['disablevlanhwfilter'] = $pconfig['disablevlanhwfilter'];
} elseif(isset($config['system']['disablevlanhwfilter'])) { } elseif(isset($config['system']['disablevlanhwfilter'])) {
unset($config['system']['disablevlanhwfilter']); unset($config['system']['disablevlanhwfilter']);
} }
if (count($input_errors) == 0) { if (count($input_errors) == 0) {
setup_polling(); setup_polling();
if (isset($config['system']['sharednet'])) { if (isset($config['system']['sharednet'])) {
system_disable_arp_wrong_if(); system_disable_arp_wrong_if();
...@@ -126,10 +129,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -126,10 +129,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config(); write_config();
$savemsg = get_std_save_message();
prefer_ipv4_or_ipv6(); prefer_ipv4_or_ipv6();
filter_configure(); filter_configure();
header("Location: system_advanced_network.php");
exit;
} }
} }
...@@ -278,8 +281,17 @@ include("head.inc"); ...@@ -278,8 +281,17 @@ include("head.inc");
<tr> <tr>
<td><a id="help_for_disablevlanhwfilter" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("VLAN Hardware Filtering"); ?></td> <td><a id="help_for_disablevlanhwfilter" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("VLAN Hardware Filtering"); ?></td>
<td> <td>
<input name="disablevlanhwfilter" type="checkbox" id="disablevlanhwfilter" value="yes" <?= !empty($pconfig['disablevlanhwfilter']) ? "checked=\"checked\"" : "";?>/> <select name="disablevlanhwfilter" class="selectpicker">
<strong><?=gettext("Disable VLAN Hardware Filtering"); ?></strong><br /> <option value="0" <?=$pconfig['disablevlanhwfilter'] == "0" ? "selected=\"selected\"" : "";?> >
<?=gettext("Enable VLAN Hardware Filtering");?>
</option>
<option value="1" <?=$pconfig['disablevlanhwfilter'] == "1" ? "selected=\"selected\"" : "";?> >
<?=gettext("Disable VLAN Hardware Filtering"); ?>
</option>
<option value="2" <?=$pconfig['disablevlanhwfilter'] == "2" ? "selected=\"selected\"" : "";?> >
<?=gettext("Leave default");?>
</option>
</select>
<div class="hidden" for="help_for_disablevlanhwfilter"> <div class="hidden" for="help_for_disablevlanhwfilter">
<?=gettext("Checking this option will disable VLAN hardware filtering. This offloading is broken in some hardware drivers, and may impact performance with some specific NICs."); ?> <?=gettext("Checking this option will disable VLAN hardware filtering. This offloading is broken in some hardware drivers, and may impact performance with some specific NICs."); ?>
<br /> <br />
......
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