NSH TFTP get command: Wrong file name used for the destination. From Lazlo
This commit is contained in:
parent
0bc4962941
commit
308818b718
@ -145,11 +145,12 @@ static inline int tftp_parsedatapacket(const uint8_t *packet,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary)
|
int tftpget(FAR const char *remote, FAR const char *local, in_addr_t addr,
|
||||||
|
bool binary)
|
||||||
{
|
{
|
||||||
struct sockaddr_in server; /* The address of the TFTP server */
|
struct sockaddr_in server; /* The address of the TFTP server */
|
||||||
struct sockaddr_in from; /* The address the last UDP message recv'd from */
|
struct sockaddr_in from; /* The address the last UDP message recv'd from */
|
||||||
uint8_t *packet; /* Allocated memory to hold one packet */
|
FAR uint8_t *packet; /* Allocated memory to hold one packet */
|
||||||
uint16_t blockno = 0; /* The current transfer block number */
|
uint16_t blockno = 0; /* The current transfer block number */
|
||||||
uint16_t opcode; /* Received opcode */
|
uint16_t opcode; /* Received opcode */
|
||||||
uint16_t rblockno; /* Received block number */
|
uint16_t rblockno; /* Received block number */
|
||||||
@ -164,7 +165,7 @@ int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary)
|
|||||||
|
|
||||||
/* Allocate the buffer to used for socket/disk I/O */
|
/* Allocate the buffer to used for socket/disk I/O */
|
||||||
|
|
||||||
packet = (uint8_t*)zalloc(TFTP_IOBUFSIZE);
|
packet = (FAR uint8_t*)zalloc(TFTP_IOBUFSIZE);
|
||||||
if (!packet)
|
if (!packet)
|
||||||
{
|
{
|
||||||
ndbg("packet memory allocation failure\n");
|
ndbg("packet memory allocation failure\n");
|
||||||
|
@ -504,7 +504,7 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
|
|
||||||
/* Get the full path to the local file */
|
/* Get the full path to the local file */
|
||||||
|
|
||||||
fullpath = nsh_getfullpath(vtbl, args.srcpath);
|
fullpath = nsh_getfullpath(vtbl, args.destpath);
|
||||||
|
|
||||||
/* Then perform the TFTP get operation */
|
/* Then perform the TFTP get operation */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user