Commit c23cc638 authored by Franco Fichtner's avatar Franco Fichtner

system: migrate ip version prefer option #832

(cherry picked from commit eb53c065)
parent b2f28859
......@@ -276,11 +276,6 @@
<syscontact/>
<rocommunity>public</rocommunity>
</snmpd>
<diag>
<ipv6nat>
<ipaddr/>
</ipv6nat>
</diag>
<syslog>
<reverse/>
</syslog>
......
......@@ -41,13 +41,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['ipv6allow'] = isset($config['system']['ipv6allow']);
$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']);
if (!isset($config['system']['disablevlanhwfilter'])) {
$pconfig['disablevlanhwfilter'] = "0";
$pconfig['disablevlanhwfilter'] = '0';
} else {
$pconfig['disablevlanhwfilter'] = $config['system']['disablevlanhwfilter'];
}
......@@ -74,12 +73,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($config['system']['ipv6allow']);
}
if (!empty($pconfig['prefer_ipv4'])) {
$config['system']['prefer_ipv4'] = true;
} elseif (isset($config['system']['prefer_ipv4'])) {
unset($config['system']['prefer_ipv4']);
}
if (!empty($pconfig['sharednet'])) {
$config['system']['sharednet'] = true;
} elseif (isset($config['system']['sharednet'])) {
......@@ -120,7 +113,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config();
setup_polling();
system_arp_wrong_if();
prefer_ipv4_or_ipv6();
filter_configure();
header("Location: system_advanced_network.php");
exit;
......@@ -202,18 +194,6 @@ include("head.inc");
<input name="ipv6nat_ipaddr" type="text" class="formfld unknown" id="ipv6nat_ipaddr" size="20" value="<?=$pconfig['ipv6nat_ipaddr'];?>" />
</td>
</tr>
<tr>
<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">
<?=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."); ?>
</div>
</td>
</tr>
<tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Network Interfaces"); ?></th>
</tr>
......@@ -237,9 +217,6 @@ include("head.inc");
<strong><?=gettext("Disable hardware checksum offload"); ?></strong>
<div class="hidden" for="help_for_disablechecksumoffloading">
<?=gettext("Checking this option will disable hardware checksum offloading. Checksum offloading is broken in some hardware, particularly some Realtek cards. Rarely, drivers may have problems with checksum offloading and some specific NICs."); ?>
<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>
......@@ -250,9 +227,6 @@ include("head.inc");
<strong><?=gettext("Disable hardware TCP segmentation offload"); ?></strong><br />
<div class="hidden" for="help_for_disablesegmentationoffloading">
<?=gettext("Checking this option will disable hardware TCP segmentation offloading (TSO, TSO4, TSO6). This offloading is broken in some hardware drivers, and may impact performance with some specific NICs."); ?>
<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>
......@@ -263,9 +237,6 @@ include("head.inc");
<strong><?=gettext("Disable hardware large receive offload"); ?></strong><br />
<div class="hidden" for="help_for_disablelargereceiveoffloading">
<?=gettext("Checking this option will disable hardware large receive offloading (LRO). This offloading is broken in some hardware drivers, and may impact performance with some specific NICs."); ?>
<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>
......@@ -285,9 +256,6 @@ include("head.inc");
</select>
<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."); ?>
<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>
......@@ -305,6 +273,11 @@ include("head.inc");
<td>&nbsp;</td>
<td><input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" /></td>
</tr>
<tr>
<td colspan="2">
<?=gettext("This will take effect after you reboot the machine or re-configure each interface.");?>
</td>
</tr>
</table>
</form>
</div>
......
......@@ -62,6 +62,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['mirror'] = 'default';
$pconfig['flavour'] = 'default';
$pconfig['prefer_ipv4'] = isset($config['system']['prefer_ipv4']);
$pconfig['hostname'] = $config['system']['hostname'];
$pconfig['domain'] = $config['system']['domain'];
if (isset($config['system']['dnsserver'])) {
......@@ -87,6 +88,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
if (!empty($pconfig['prefer_ipv4'])) {
$config['system']['prefer_ipv4'] = true;
} elseif (isset($config['system']['prefer_ipv4'])) {
unset($config['system']['prefer_ipv4']);
}
if (isset($config['system']['firmware']['mirror'])) {
$pconfig['mirror'] = $config['system']['firmware']['mirror'];
}
......@@ -184,7 +191,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['system']['firmware']['flavour'] = $pconfig['flavour'];
}
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
$olddnsservers = $config['system']['dnsserver'];
$config['system']['dnsserver'] = array();
foreach (array('dns1', 'dns2', 'dns3', 'dns4') as $dnsopt) {
......@@ -249,16 +255,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
}
write_config();
prefer_ipv4_or_ipv6();
system_hostname_configure();
system_hosts_generate();
system_resolvconf_generate();
if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) {
services_unbound_configure();
}
system_timezone_configure();
system_firmware_configure();
......@@ -266,7 +271,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
configd_run("dns reload");
}
// Reload the filter - plugins might need to be run.
filter_configure();
$savemsg = get_std_save_message();
......@@ -408,6 +412,18 @@ include("head.inc");
</div>
</td>
</tr>
<tr>
<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($pconfig['prefer_ipv4']) ? "checked=\"checked\"" : "";?> />
<strong><?=gettext("Prefer to use IPv4 even if IPv6 is available"); ?></strong>
<div class="hidden" for="help_for_prefer_ipv4">
<?=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."); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_timezone" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Time zone"); ?></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