|
@@ -156,16 +156,14 @@ static void reprioritise_settings ( struct settings *settings ) {
|
156
|
156
|
return;
|
157
|
157
|
|
158
|
158
|
/* Read priority, if present */
|
159
|
|
- priority = 0;
|
160
|
|
- fetch_int_setting ( settings, DHCP_EB_PRIORITY, &priority );
|
|
159
|
+ priority = fetch_intz_setting ( settings, DHCP_EB_PRIORITY );
|
161
|
160
|
|
162
|
161
|
/* Remove from siblings list */
|
163
|
162
|
list_del ( &settings->siblings );
|
164
|
163
|
|
165
|
164
|
/* Reinsert after any existing blocks which have a higher priority */
|
166
|
165
|
list_for_each_entry ( tmp, &parent->children, siblings ) {
|
167
|
|
- tmp_priority = 0;
|
168
|
|
- fetch_int_setting ( tmp, DHCP_EB_PRIORITY, &tmp_priority );
|
|
166
|
+ tmp_priority = fetch_intz_setting ( tmp, DHCP_EB_PRIORITY );
|
169
|
167
|
if ( priority > tmp_priority )
|
170
|
168
|
break;
|
171
|
169
|
}
|
|
@@ -441,6 +439,35 @@ int fetch_uint_setting ( struct settings *settings, unsigned int tag,
|
441
|
439
|
return len;
|
442
|
440
|
}
|
443
|
441
|
|
|
442
|
+/**
|
|
443
|
+ * Fetch value of signed integer setting, or zero
|
|
444
|
+ *
|
|
445
|
+ * @v settings Settings block, or NULL to search all blocks
|
|
446
|
+ * @v tag Setting tag number
|
|
447
|
+ * @ret value Setting value, or zero
|
|
448
|
+ */
|
|
449
|
+long fetch_intz_setting ( struct settings *settings, unsigned int tag ) {
|
|
450
|
+ long value = 0;
|
|
451
|
+
|
|
452
|
+ fetch_int_setting ( settings, tag, &value );
|
|
453
|
+ return value;
|
|
454
|
+}
|
|
455
|
+
|
|
456
|
+/**
|
|
457
|
+ * Fetch value of unsigned integer setting, or zero
|
|
458
|
+ *
|
|
459
|
+ * @v settings Settings block, or NULL to search all blocks
|
|
460
|
+ * @v tag Setting tag number
|
|
461
|
+ * @ret value Setting value, or zero
|
|
462
|
+ */
|
|
463
|
+unsigned long fetch_uintz_setting ( struct settings *settings,
|
|
464
|
+ unsigned int tag ) {
|
|
465
|
+ unsigned long value = 0;
|
|
466
|
+
|
|
467
|
+ fetch_uint_setting ( settings, tag, &value );
|
|
468
|
+ return value;
|
|
469
|
+}
|
|
470
|
+
|
444
|
471
|
/******************************************************************************
|
445
|
472
|
*
|
446
|
473
|
* Named and typed setting routines
|