From 6621b0e70686d3527a1a6a225e6b136d9869004e Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 14 Nov 2009 22:08:07 +0100 Subject: [PATCH] 2009-11-14 Vladimir Serbinenko * fs/i386/pc/pxe.c (grub_pxefs_open): Correctly handle PXE choosing blocksize different from specified. (grub_pxefs_read): Likewise. --- ChangeLog.pxefix | 6 ++++++ fs/i386/pc/pxe.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 ChangeLog.pxefix diff --git a/ChangeLog.pxefix b/ChangeLog.pxefix new file mode 100644 index 000000000..a599f9eef --- /dev/null +++ b/ChangeLog.pxefix @@ -0,0 +1,6 @@ +2009-11-14 Vladimir Serbinenko + + * fs/i386/pc/pxe.c (grub_pxefs_open): Correctly handle PXE choosing + blocksize different from specified. + (grub_pxefs_read): Likewise. + diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index 4032e1254..6c41d4298 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -150,7 +150,7 @@ grub_pxefs_open (struct grub_file *file, const char *name) if (! data) return grub_errno; - data->block_size = grub_pxe_blksize; + data->block_size = c.c2.packet_size; grub_strcpy (data->filename, name); file_int = grub_malloc (sizeof (*file_int)); @@ -205,13 +205,14 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) o.gateway_ip = grub_pxe_gateway_ip; grub_strcpy ((char *)&o.filename[0], data->filename); o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT); - o.packet_size = data->block_size; + o.packet_size = grub_pxe_blksize; grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o); if (o.status) { grub_error (GRUB_ERR_BAD_FS, "open fails"); return -1; } + data->block_size = o.packet_size; data->packet_number = 0; curr_file = file; } @@ -219,7 +220,7 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) c.buffer = SEGOFS (GRUB_MEMORY_MACHINE_SCRATCH_ADDR); while (pn >= data->packet_number) { - c.buffer_size = grub_pxe_blksize; + c.buffer_size = data->block_size; grub_pxe_call (GRUB_PXENV_TFTP_READ, &c); if (c.status) {