NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/57166: tftp does not correctly byte swap the error code for display
>Number: 57166
>Category: bin
>Synopsis: tftp does not correctly byte swap the error code for display
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 06 00:10:00 +0000 2023
>Originator: John Dundas
>Release:
>Organization:
>Environment:
>Description:
When an ERROR packet is returned by tftpd, tftp (the client) does not correctly byteswap the error code prior to display.
>How-To-Repeat:
tftp> binary
tftp> trace
tftp> put /file.txt
sent WRQ <file=/file.txt, mode=octet>
received ERROR <code=2, msg=Access violation>
Error code 512: Access violation
tftp>
Note that the code "2" is correct; "512" is not correct, it should also be "2".
>Fix:
In both recvfile() and tftp_sendfile(), the incorrect line is:
printf ("Error code %d: %s\n", dp->th_code, dp->th_msg);
I believe this should instead read:
printf ("Error code %d: %s\n", ntohs (dp->th_code), dp->th_msg);
Note that the routine tpacket() does display the error code correctly.
Home |
Main Index |
Thread Index |
Old Index