|
@@ -56,8 +56,10 @@ static unsigned int pxe_single_blkidx;
|
56
|
56
|
* @v port Server port (in network byte order)
|
57
|
57
|
* @v filename File name
|
58
|
58
|
* @v blksize Requested block size, or 0
|
|
59
|
+ *
|
|
60
|
+ * The URI string buffer must be at least @c PXE_URI_LEN bytes long.
|
59
|
61
|
*/
|
60
|
|
-static void pxe_tftp_build_uri ( char uri_string[PXE_URI_LEN],
|
|
62
|
+static void pxe_tftp_build_uri ( char *uri_string,
|
61
|
63
|
uint32_t ipaddress, unsigned int port,
|
62
|
64
|
const unsigned char *filename,
|
63
|
65
|
int blksize ) {
|
|
@@ -73,7 +75,7 @@ static void pxe_tftp_build_uri ( char uri_string[PXE_URI_LEN],
|
73
|
75
|
blksize = TFTP_MAX_BLKSIZE;
|
74
|
76
|
tftp_set_request_blksize ( blksize );
|
75
|
77
|
|
76
|
|
- snprintf ( uri_string, sizeof ( uri_string ), "tftp://%s:%d%s%s",
|
|
78
|
+ snprintf ( uri_string, PXE_URI_LEN, "tftp://%s:%d%s%s",
|
77
|
79
|
inet_ntoa ( address ), ntohs ( port ),
|
78
|
80
|
( ( filename[0] == '/' ) ? "" : "/" ), filename );
|
79
|
81
|
}
|
|
@@ -372,6 +374,9 @@ PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
|
372
|
374
|
tftp_read_file->FileName, 0 );
|
373
|
375
|
DBG ( " %s", uri_string );
|
374
|
376
|
|
|
377
|
+ DBG ( " to %08lx+%lx", tftp_read_file->Buffer,
|
|
378
|
+ tftp_read_file->BufferSize );
|
|
379
|
+
|
375
|
380
|
/* Open URI */
|
376
|
381
|
fd = open ( uri_string );
|
377
|
382
|
if ( fd < 0 ) {
|