summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_snp_hii.c
diff options
context:
space:
mode:
authorMichael Brown2013-11-19 16:34:58 +0100
committerMichael Brown2013-12-05 13:43:28 +0100
commiteaa86156484d72f50825fec3e313a732f258fd31 (patch)
tree9e2b04c4e3cee6c27b78a3449bf36ce23b0ae895 /src/interface/efi/efi_snp_hii.c
parent[settings] Force settings into alphabetical order within sections (diff)
downloadipxe-eaa86156484d72f50825fec3e313a732f258fd31.tar.gz
ipxe-eaa86156484d72f50825fec3e313a732f258fd31.tar.xz
ipxe-eaa86156484d72f50825fec3e313a732f258fd31.zip
[settings] Allow for multiple definitions of each predefined setting
Allow for multiple setting definitions with the same name but different scopes and tags. For example, allow for a "filename" setting with default scope and tag value 67 (for DHCPv4) and a corresponding "filename" setting with IPv6 scope and tag value 59 (for DHCPv6). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_snp_hii.c')
-rw-r--r--src/interface/efi/efi_snp_hii.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/interface/efi/efi_snp_hii.c b/src/interface/efi/efi_snp_hii.c
index 61954b63..c272527c 100644
--- a/src/interface/efi/efi_snp_hii.c
+++ b/src/interface/efi/efi_snp_hii.c
@@ -126,6 +126,7 @@ static void efi_snp_hii_questions ( struct efi_snp_device *snpdev,
struct efi_ifr_builder *ifr,
unsigned int varstore_id ) {
struct setting *setting;
+ struct setting *previous = NULL;
unsigned int name_id;
unsigned int prompt_id;
unsigned int help_id;
@@ -135,6 +136,9 @@ static void efi_snp_hii_questions ( struct efi_snp_device *snpdev,
for_each_table_entry ( setting, SETTINGS ) {
if ( ! efi_snp_hii_setting_applies ( snpdev, setting ) )
continue;
+ if ( previous && ( setting_cmp ( setting, previous ) == 0 ) )
+ continue;
+ previous = setting;
name_id = efi_ifr_string ( ifr, "%s", setting->name );
prompt_id = efi_ifr_string ( ifr, "%s", setting->description );
help_id = efi_ifr_string ( ifr, "http://ipxe.org/cfg/%s",