diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-06-29 01:42:59 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-06-29 01:42:59 +0100 |
commit | 40d6d3dcf4b283272d3bd8166164b4622a85530b (patch) | |
tree | edb41056ca755b6fc3252bd7e802f45d70537ed0 /src | |
parent | 6f14c9d169a5229c92904ea50a97a35db5f4bc59 (diff) | |
download | ipxe-40d6d3dcf4b283272d3bd8166164b4622a85530b.zip ipxe-40d6d3dcf4b283272d3bd8166164b4622a85530b.tar.gz ipxe-40d6d3dcf4b283272d3bd8166164b4622a85530b.tar.bz2 |
Windows RIS now gets as far as downloading NTLDR.
Diffstat (limited to 'src')
-rw-r--r-- | src/interface/pxe/pxe_preboot.c | 10 | ||||
-rw-r--r-- | src/interface/pxe/pxe_tftp.c | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/interface/pxe/pxe_preboot.c b/src/interface/pxe/pxe_preboot.c index 09fa5fe..862c0dd 100644 --- a/src/interface/pxe/pxe_preboot.c +++ b/src/interface/pxe/pxe_preboot.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <gpxe/uaccess.h> #include <gpxe/dhcp.h> +#include <dhcp_basemem.h> #include "pxe.h" #include "pxe_callbacks.h" @@ -85,11 +86,13 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO * sources of options. */ if ( get_cached_info->BufferLimit == 0 ) { - DBG ( " without an external buffer. Aargh." ); - goto err; + get_cached_info->Buffer.segment = rm_ds; + get_cached_info->Buffer.offset = + ( unsigned int ) ( & __from_data16 ( dhcp_basemem ) ); + get_cached_info->BufferLimit = sizeof ( dhcp_basemem ); } - DBG ( " to %04x:%04x+%x\n", get_cached_info->Buffer.segment, + DBG ( " to %04x:%04x+%x", get_cached_info->Buffer.segment, get_cached_info->Buffer.offset, get_cached_info->BufferLimit ); /* Allocate space for temporary copy */ @@ -121,6 +124,7 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO /* Copy packet to client buffer */ buffer = real_to_user ( get_cached_info->Buffer.segment, get_cached_info->Buffer.offset ); + len = dhcppkt.len; copy_to_user ( buffer, 0, data, len ); get_cached_info->BufferSize = len; diff --git a/src/interface/pxe/pxe_tftp.c b/src/interface/pxe/pxe_tftp.c index 919d5c9..56529b1 100644 --- a/src/interface/pxe/pxe_tftp.c +++ b/src/interface/pxe/pxe_tftp.c @@ -56,8 +56,10 @@ static unsigned int pxe_single_blkidx; * @v port Server port (in network byte order) * @v filename File name * @v blksize Requested block size, or 0 + * + * The URI string buffer must be at least @c PXE_URI_LEN bytes long. */ -static void pxe_tftp_build_uri ( char uri_string[PXE_URI_LEN], +static void pxe_tftp_build_uri ( char *uri_string, uint32_t ipaddress, unsigned int port, const unsigned char *filename, int blksize ) { @@ -73,7 +75,7 @@ static void pxe_tftp_build_uri ( char uri_string[PXE_URI_LEN], blksize = TFTP_MAX_BLKSIZE; tftp_set_request_blksize ( blksize ); - snprintf ( uri_string, sizeof ( uri_string ), "tftp://%s:%d%s%s", + snprintf ( uri_string, PXE_URI_LEN, "tftp://%s:%d%s%s", inet_ntoa ( address ), ntohs ( port ), ( ( filename[0] == '/' ) ? "" : "/" ), filename ); } @@ -372,6 +374,9 @@ PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE tftp_read_file->FileName, 0 ); DBG ( " %s", uri_string ); + DBG ( " to %08lx+%lx", tftp_read_file->Buffer, + tftp_read_file->BufferSize ); + /* Open URI */ fd = open ( uri_string ); if ( fd < 0 ) { |