[syslinux:pathbased] pxe: make have_uuid a bool
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Sun Mar 7 21:09:10 PST 2010
Commit-ID: 860d9434a0dd755464ad77c82d363954a123416b
Gitweb: http://syslinux.zytor.com/commit/860d9434a0dd755464ad77c82d363954a123416b
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sun, 7 Mar 2010 20:50:35 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Sun, 7 Mar 2010 21:01:26 -0800
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 at zytor.com>
---
core/fs/pxe/dhcp_option.c | 5 ++---
core/fs/pxe/pxe.c | 2 +-
core/fs/pxe/pxe.h | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/core/fs/pxe/dhcp_option.c b/core/fs/pxe/dhcp_option.c
index a926469..e18b605 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 0c7b768..0bc9b36 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 a43b158..493d276 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[];
More information about the Syslinux-commits
mailing list