diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-10-13 10:42:14 -0500 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-10-13 10:42:14 -0500 |
commit | 1c764a3a50d4eb732e7c96eb9351e7b35c2051d4 (patch) | |
tree | 3203b13446c28f556a6d534bf1adeb6f4649de9d | |
parent | 3b5b437baaa9c986edbb73a0e6570ec365550b86 (diff) | |
download | pfsense-1c764a3a50d4eb732e7c96eb9351e7b35c2051d4.zip pfsense-1c764a3a50d4eb732e7c96eb9351e7b35c2051d4.tar.gz |
GIF interfaces MTU must be something between 1280 and 8192, make the correct check. It fixes #3927
-rw-r--r-- | usr/local/www/interfaces.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 55f02a4..0f39eda 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -710,8 +710,18 @@ if ($_POST['apply']) { if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) $input_errors[] = gettext("A valid MAC address must be specified."); if ($_POST['mtu']) { - if ($_POST['mtu'] < 576 || $_POST['mtu'] > 9000) - $input_errors[] = gettext("The MTU must be greater than 576 bytes and less than 9000."); + if (substr($wancfg['if'], 0, 3) == 'gif') { + $min_mtu = 1280; + $max_mtu = 8192; + } else { + $min_mtu = 576; + $max_mtu = 9000; + } + + if ($_POST['mtu'] < $min_mtu || $_POST['mtu'] > $max_mtu) + $input_errors[] = sprintf(gettext("The MTU must be greater than %d bytes and less than %d."), $min_mtu, $max_mtu); + + unset($min_mtu, $max_mtu); if (stristr($wancfg['if'], "_vlan")) { $realhwif_array = get_parent_interface($wancfg['if']); |