Projet

Général

Profil

« Précédent | Suivant » 

Révision 1c764a3a

Ajouté par Renato Botelho il y a plus de 9 ans

GIF interfaces MTU must be something between 1280 and 8192, make the correct check. It fixes #3927

Voir les différences:

usr/local/www/interfaces.php
710 710
	if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac'])))
711 711
		$input_errors[] = gettext("A valid MAC address must be specified.");
712 712
	if ($_POST['mtu']) {
713
		if ($_POST['mtu'] < 576 || $_POST['mtu'] > 9000)
714
			$input_errors[] = gettext("The MTU must be greater than 576 bytes and less than 9000.");
713
		if (substr($wancfg['if'], 0, 3) == 'gif') {
714
			$min_mtu = 1280;
715
			$max_mtu = 8192;
716
		} else {
717
			$min_mtu = 576;
718
			$max_mtu = 9000;
719
		}
720

  
721
		if ($_POST['mtu'] < $min_mtu || $_POST['mtu'] > $max_mtu)
722
			$input_errors[] = sprintf(gettext("The MTU must be greater than %d bytes and less than %d."), $min_mtu, $max_mtu);
723

  
724
		unset($min_mtu, $max_mtu);
715 725

  
716 726
		if (stristr($wancfg['if'], "_vlan")) {
717 727
			$realhwif_array = get_parent_interface($wancfg['if']);

Formats disponibles : Unified diff