Project

General

Profile

Bug #6227 » interfaces.inc.diff

Chris Rowe, 04/22/2016 03:16 AM

View differences:

interfaces.inc 2016-04-21 19:44:08.653020000 +0100
772 772

  
773 773
	/* Check if MTU was defined for this lagg interface */
774 774
	$lagg_mtu = interface_find_child_cfgmtu($laggif);
775
	
775 776
	if ($lagg_mtu == 0 &&
776 777
	    is_array($config['interfaces'])) {
777 778
		foreach ($config['interfaces'] as $tmpinterface) {
......
782 783
			}
783 784
		}
784 785
	}
785

  
786
	
786 787
	/* Just in case anything is not working well */
787 788
	if ($lagg_mtu == 0) {
788 789
		$lagg_mtu = 1500;
......
4971 4972

  
4972 4973
	$interface = convert_real_interface_to_friendly_interface_name($realiface);
4973 4974
	$vlans = link_interface_to_vlans($realiface);
4975
	$qinqs = link_interface_to_qinqs($realiface);
4974 4976
	$bridge = link_interface_to_bridge($realiface);
4975 4977
	if (!empty($interface)) {
4976 4978
		$gifs = link_interface_to_gif($interface);
......
4994 4996
			}
4995 4997
		}
4996 4998
	}
4999
	if (is_array($qinqs)) {
5000
		foreach ($qinqs as $qinq) {
5001
			$ifass = convert_real_interface_to_friendly_interface_name($qinq['vlanif']);
5002
			if (empty($ifass)) {
5003
				continue;
5004
			}
5005
			if (!empty($config['interfaces'][$ifass]['mtu'])) {
5006
				if (intval($config['interfaces'][$ifass]['mtu']) > $mtu) {
5007
					$mtu = intval($config['interfaces'][$ifass]['mtu']);
5008
				}
5009
			}
5010
		}
5011
	}
4997 5012
	if (is_array($gifs)) {
4998 5013
		foreach ($gifs as $gif) {
4999 5014
			$ifass = convert_real_interface_to_friendly_interface_name($gif['gifif']);
......
5055 5070
	}
5056 5071
}
5057 5072

  
5073
function link_interface_to_qinqs($int, $action = "") {
5074
	global $config;
5075

  
5076
	if (empty($int)) {
5077
		return;
5078
	}
5079

  
5080
	if (is_array($config['qinqs']['qinqentry'])) {
5081
		$ifaces = array();
5082
		foreach ($config['qinqs']['qinqentry'] as $qinq) {
5083
			if ($int == $qinq['if']) {
5084
				if ($action == "update") {
5085
					interfaces_bring_up($int);
5086
				} else {
5087
					$ifaces[$qinq['tag']] = $qinq;
5088
				}
5089
			}
5090
		}
5091
		if (!empty($ifaces)) {
5092
			return $ifaces;
5093
		}
5094
	}
5095
}
5096

  
5058 5097
function link_interface_to_vips($int, $action = "", $vhid = '') {
5059 5098
	global $config;
5060 5099

  
(2-2/2)