aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-03-07 20:50:35 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-03-07 21:01:26 -0800
commit860d9434a0dd755464ad77c82d363954a123416b (patch)
treeb6c0b323b1ed437c50097ceeac9d0a7dab98be71
parent5e0674b819d373f3fd9306fe6c7bc9f5e63ed36c (diff)
downloadsyslinux-860d9434a0dd755464ad77c82d363954a123416b.tar.gz
syslinux-860d9434a0dd755464ad77c82d363954a123416b.tar.xz
syslinux-860d9434a0dd755464ad77c82d363954a123416b.zip
pxe: make have_uuid a bool
Make have_uuid a bool, and clarify the logic for setting it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/fs/pxe/dhcp_option.c5
-rw-r--r--core/fs/pxe/pxe.c2
-rw-r--r--core/fs/pxe/pxe.h2
3 files changed, 4 insertions, 5 deletions
diff --git a/core/fs/pxe/dhcp_option.c b/core/fs/pxe/dhcp_option.c
index a9264695..e18b605d 100644
--- a/core/fs/pxe/dhcp_option.c
+++ b/core/fs/pxe/dhcp_option.c
@@ -113,11 +113,10 @@ static void bootfile_name(void *data, int opt_len)
static void uuid_client_identifier(void *data, int opt_len)
{
int type = *(uint8_t *)data;
- if (opt_len != 17 ||
- (type | have_uuid))
+ if (opt_len != 17 || type != 0 || have_uuid)
return;
- have_uuid = 1;
+ have_uuid = true;
uuid_type = type;
memcpy(uuid, data+1, 16);
uuid[16] = 0;
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 0c7b768c..0bc9b361 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -28,7 +28,7 @@ char dot_quad_buf[16];
static bool has_gpxe;
static uint32_t gpxe_funcs;
static uint8_t uuid_dashes[] = {4, 2, 2, 2, 6, 0};
-int have_uuid = 0;
+bool have_uuid = false;
/* Port number bitmap - port numbers 49152 (0xc000) to 57343 (0xefff) */
#define PORT_NUMBER_BASE 49152
diff --git a/core/fs/pxe/pxe.h b/core/fs/pxe/pxe.h
index a43b1580..493d2768 100644
--- a/core/fs/pxe/pxe.h
+++ b/core/fs/pxe/pxe.h
@@ -204,7 +204,7 @@ extern uint8_t KeepPXE;
extern far_ptr_t InitStack;
-extern int have_uuid;
+extern bool have_uuid;
extern uint8_t uuid_type;
extern char uuid[];