tftpd mode check should ignore case

Denys Vlasenko vda.linux at googlemail.com
Thu Oct 6 15:34:18 UTC 2011


On Thu, Oct 6, 2011 at 11:38 AM, Brecht Ameije <bam at abm.be> wrote:
> When using Busybox tftpd as a tftp server in combination with the RedBoot
> tftp client, I got a "malformed packet" response to every request.
>
> The reason is that RedBoot requests "OCTET" mode in upper case, where
> Busybox only checks for the lower case "octet" mode variant.
>
> The tftp RFC 1350 states: "The mode field contains the
>   string "netascii", "octet", or "mail" (or any combination of upper
>   and lower case, such as "NETASCII", NetAscii", etc.) in netascii
>   indicating the three modes defined in the protocol.
>
> Therefore I suggest to change busybox-1.19.0/networking/tftp.c line 816:
>
> -       if (mode >= block_buf + result || strcmp(mode, "octet") != 0) {
> +       if (mode >= block_buf + result || strcasecmp(mode, "octet") != 0) {

Applied, thanks!
-- 
vda


More information about the busybox mailing list