0

I am writing a TFTP Client using C++. I was able to send a read request using "octet" mode to a default TFTP Client (tftpd32). The problem is that I am unable to send the ACK back at the regular TFTP respond. I am getting the following error:

Connection received from 127.0.0.1 on port 51401 [27/07 23:03:15.612]
Read request for file <test.txt>. Mode octet [27/07 23:03:15.612]
Using local port 51402 [27/07 23:03:15.612]
Connection received from 127.0.0.1 on port 51401 [27/07 23:03:18.624]
Unexpected request 4 from peer [27/07 23:03:18.624]
Returning EBADOP to Peer [27/07 23:03:18.624]

Why I am able to send the RRQ but not the ACK using the same method?

SpcCode
  • 887
  • 2
  • 13
  • 24
  • Use a tool like Wireshark to find out what exactly is beeing send over the wire. Maybe that makes it easier to spot the error. – rve Aug 25 '12 at 09:56

1 Answers1

0

Probably a not well conformed ACK packet? It looks like you are sending a request with an ACK opcode…

The form of the ACK packet from RFC 1350:

                 2 bytes     2 bytes
                 ---------------------
                | Opcode |   Block #  |
                 ---------------------

where opcode=4

Pat
  • 2,670
  • 18
  • 27