Project

General

Profile

« Previous | Next » 

Revision 9d775c75

Added by Renato Botelho almost 8 years ago

Fix #7949

Add UEFI 32 and UEFI 64 filenames defined inside a pool to dhcpd.conf

View differences:

src/etc/inc/services.inc
929 929
				if (!empty($poolconf['nextserver']) && ($poolconf['nextserver'] != $dhcpifconf['nextserver'])) {
930 930
					$dhcpdconf .= "		next-server {$poolconf['nextserver']};\n";
931 931
				}
932
				if (!empty($poolconf['filename']) && ($poolconf['filename'] != $dhcpifconf['filename'])) {
933
					$dhcpdconf .= "		filename \"{$poolconf['filename']}\";\n";
932

  
933
				if (!empty($poolconf['filename']) &&
934
				    (!isset($dhcpifconf['filename']) ||
935
				    ($poolconf['filename'] != $dhcpifconf['filename']))) {
936
					$filename = $poolconf['filename'];
937
				}
938
				if (!empty($poolconf['filename32']) &&
939
				    (!isset($dhcpifconf['filename32']) ||
940
				    ($poolconf['filename32'] != $dhcpifconf['filename32']))) {
941
					$filename32 = $poolconf['filename32'];
942
				}
943
				if (!empty($poolconf['filename64']) &&
944
				    (!isset($dhcpifconf['filename64']) ||
945
				    ($poolconf['filename64'] != $dhcpifconf['filename64']))) {
946
					$filename64 = $poolconf['filename64'];
934 947
				}
948

  
949
				if (!empty($filename32) || !empty($filename64)) {
950
					if (empty($filename) && !empty($dhcpifconf['filename'])) {
951
						$filename = $dhcpifconf['filename'];
952
					}
953
					if (empty($filename32) && !empty($dhcpifconf['filename32'])) {
954
						$filename32 = $dhcpifconf['filename32'];
955
					}
956
					if (empty($filename64) && !empty($dhcpifconf['filename64'])) {
957
						$filename64 = $dhcpifconf['filename64'];
958
					}
959
				}
960

  
961
				if (!empty($filename) && !empty($filename32) && !empty($filename64)) {
962
					$dhcpdconf .= "		if option arch = 00:06 {\n";
963
					$dhcpdconf .= "			filename \"{$filename32}\";\n";
964
					$dhcpdconf .= "		} else if option arch = 00:07 {\n";
965
					$dhcpdconf .= "			filename \"{$filename64}\";\n";
966
					$dhcpdconf .= "		} else if option arch = 00:09 {\n";
967
					$dhcpdconf .= "			filename \"{$filename64}\";\n";
968
					$dhcpdconf .= "		} else {\n";
969
					$dhcpdconf .= "			filename \"{$filename}\";\n";
970
					$dhcpdconf .= "		}\n\n";
971
				} elseif (!empty($filename)) {
972
					$dhcpdconf .= "		filename \"{$filename}\";\n";
973
				}
974
				unset($filename, $filename32, $filename64);
975

  
935 976
				if (!empty($poolconf['rootpath']) && ($poolconf['rootpath'] != $dhcpifconf['rootpath'])) {
936 977
					$dhcpdconf .= "		option root-path \"{$poolconf['rootpath']}\";\n";
937 978
				}

Also available in: Unified diff