qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] slirp/tftp.c: fix mode field
@ 2011-01-10 21:46 Sergei Gavrikov
  2011-01-12  7:22 ` [Qemu-devel] " Sergei Gavrikov
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Gavrikov @ 2011-01-10 21:46 UTC (permalink / raw)
  To: QEMU Developers

Hi,

According to RFC 1350 http://www.ietf.org/rfc/rfc1350.txt [Page 5]:

    The mode field contains the string "netascii", "octet", or "mail"
    (or any combination of upper and lower case, such as "NETASCII",
    NetAscii", etc.)

Unfortunately, current implementation of internal TFTP server breaks the
requests with the mode fields like "OCTET\0". For example, the RedBoot's
TFTP client sends the same (in upper case). So, it is not possible to
get internal TFTP working with RedBoot loader. If you do not have doubts
about STRCASECMP(3), a patch is provided.

Thanks,
Sergei

Signed-off-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
---
 slirp/tftp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/slirp/tftp.c b/slirp/tftp.c
index 55e4692..6ad1da0 100644
--- a/slirp/tftp.c
+++ b/slirp/tftp.c
@@ -311,7 +311,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen)
     return;
   }
 
-  if (memcmp(&tp->x.tp_buf[k], "octet\0", 6) != 0) {
+  if (strcasecmp(&tp->x.tp_buf[k], "octet") != 0) {
       tftp_send_error(spt, 4, "Unsupported transfer mode", tp);
       return;
   }

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-13 10:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10 21:46 [Qemu-devel] [PATCH] slirp/tftp.c: fix mode field Sergei Gavrikov
2011-01-12  7:22 ` [Qemu-devel] " Sergei Gavrikov
2011-01-12  9:56   ` Stefan Hajnoczi
2011-01-12 10:22     ` Sergei Gavrikov
2011-01-12 12:17       ` Stefan Hajnoczi
2011-01-12 12:32         ` Sergei Gavrikov
2011-01-12 13:57         ` [Qemu-devel] [PATCHv1] slirp: Use strcasecmp() to check tftp mode, tsize Sergei Gavrikov
2011-01-13 10:40           ` Edgar E. Iglesias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).