Skip to content

Commit

Permalink
interfaces: update maximum MTU for 10Gb NICs
Browse files Browse the repository at this point in the history
(cherry picked from commit 13f8ba2)
(cherry picked from commit 29b6820)
  • Loading branch information
darkfires authored and fichtner committed Feb 11, 2020
1 parent a1e78f7 commit bc778b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/www/interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,10 @@ interface_sync_wireless_clones($a_interfaces[$if], false);
$input_errors[] = gettext("A valid MAC address must be specified.");
}
if (!empty($pconfig['mtu'])) {
if ($pconfig['mtu'] < 576 || $pconfig['mtu'] > 9000) {
$input_errors[] = gettext("The MTU must be greater than 576 bytes and less than 9000.");
$mtu_low = 576;
$mtu_high = 9214;
if ($pconfig['mtu'] < $mtu_low || $pconfig['mtu'] > $mtu_high) {
$input_errors[] = sprintf(gettext('The MTU must be greater than %s bytes and less than %s.'), $mtu_low, $mtu_high);
}

if (stristr($a_interfaces[$if]['if'], "_vlan")) {
Expand Down
9 changes: 7 additions & 2 deletions src/www/interfaces_lagg_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,13 @@ function available_interfaces($selected_id=null)
if (!in_array($pconfig['proto'], $laggprotos)) {
$input_errors[] = gettext("Protocol supplied is invalid");
}
if (!empty($pconfig['mtu']) && ($pconfig['mtu'] < 576 || $pconfig['mtu'] > 9000)) {
$input_errors[] = gettext("The MTU must be greater than 576 bytes and less than 9000.");

if (!empty($pconfig['mtu'])) {
$mtu_low = 576;
$mtu_high = 9214;
if ($pconfig['mtu'] < $mtu_low || $pconfig['mtu'] > $mtu_high) {
$input_errors[] = sprintf(gettext('The MTU must be greater than %s bytes and less than %s.'), $mtu_low, $mtu_high);
}
}

if (count($input_errors) == 0) {
Expand Down

0 comments on commit bc778b3

Please sign in to comment.