Commit c68ca487 authored by Ad Schellevis's avatar Ad Schellevis

(interfaces, lagg) add lacp_fast_timeout support https://github.com/opnsense/core/issues/1105

parent ee6a8076
......@@ -781,6 +781,11 @@ function interface_lagg_configure(&$lagg)
}
mwexec("/sbin/ifconfig {$laggif} laggproto " . escapeshellarg($lagg['proto']));
if (!empty($lagg['lacp_fast_timeout'])) {
mwexec("/sbin/ifconfig {$laggif} lacp_fast_timeout");
} elseif ($lagg['proto'] == 'lacp') {
mwexec("/sbin/ifconfig {$laggif} -lacp_fast_timeout");
}
interfaces_bring_up($laggif);
......
......@@ -94,6 +94,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['members'] = isset($a_laggs[$id]['members']) ? explode(",", $a_laggs[$id]['members']) : array();
$pconfig['proto'] = isset($a_laggs[$id]['proto']) ? $a_laggs[$id]['proto'] : null;
$pconfig['descr'] = isset($a_laggs[$id]['descr']) ? $a_laggs[$id]['descr'] : null;
$pconfig['lacp_fast_timeout'] = !empty($a_laggs[$id]['lacp_fast_timeout']);
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
// validate and save form data
if (!empty($a_laggs[$_POST['id']])) {
......@@ -126,6 +127,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$lagg['descr'] = $pconfig['descr'];
$lagg['laggif'] = $pconfig['laggif'];
$lagg['proto'] = $pconfig['proto'];
$lagg['lacp_fast_timeout'] = !empty($pconfig['lacp_fast_timeout']);
if (isset($id)) {
$lagg['laggif'] = $a_laggs[$id]['laggif'];
}
......@@ -156,6 +158,21 @@ legacy_html_escape_form_data($pconfig);
?>
<body>
<script type="text/javascript">
$( document ).ready(function() {
$("#proto").change(function(){
if ($("#proto").val() == 'lacp') {
$("#lacp_fast_timeout").parent().parent().show();
$("#lacp_fast_timeout").prop( "disabled", false );
} else {
$("#lacp_fast_timeout").parent().parent().hide();
$("#lacp_fast_timeout").prop( "disabled", true );
}
});
$("#proto").change();
});
</script>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
......@@ -258,6 +275,15 @@ legacy_html_escape_form_data($pconfig);
</div>
</td>
</tr>
<tr>
<td><a id="help_for_lacp_fast_timeout" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Fast timeout"); ?></td>
<td>
<input name="lacp_fast_timeout" id="lacp_fast_timeout" type="checkbox" value="yes" <?=!empty($pconfig['lacp_fast_timeout']) ? "checked=\"checked\"" : "" ;?>/>
<div class="hidden" for="help_for_lacp_fast_timeout">
<?=gettext("Enable lacp fast-timeout on the interface."); ?>
</div>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
......
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