[BusyBox] tftp get doesn't ack the last data block

Jean-Christophe Dubois jdubois at mc.com
Wed Dec 18 10:39:04 UTC 2002


Hello,

So here it is. As I said, it is a quick hack but it works. I may be
possible to restructure the code better. Also I didn't test the put
command because I am not using it so far. I may some time later.

Regards

JC

PS: the diff format is with "-ruN" option. If you want some other form,
please ask.

--- busybox-0.60.5.org/tftp.c   Fri Oct 25 14:05:51 2002
+++ busybox-0.60.5/tftp.c       Wed Dec 18 18:31:11 2002
@@ -282,8 +282,6 @@
                                }

                                cp += len;
-                       } else if (finished) {
-                               break;
                        }
                }

@@ -309,6 +307,8 @@
                        }


+                       if (finished) break;
+
                        /* receive packet */


@@ -362,6 +362,8 @@

                } while (timeout && (len >= 0));

+               if (finished) break;
+
                if (len < 0) {
                        break;
                }


On Wed, 2002-12-18 at 16:55, Magnus Damm wrote:
> Hi,
> 
> Yes, it seems like a bug to me, sorry about that.
> Please post your fix to the list.
> 
> Thanks /
> 
> magnus
> 
> Jean-Christophe Dubois wrote:
> > 
> > Hi,
> > 
> > I am new to the mailing list but I'd like to report what I think is a
> > bug. Sorry if it is an already discussed issue but it doesn't show in
> > the list of outstanding bugs (maybe it is not a bug).
> > 
> > Well, I am not an expert in RFC and all but what the behavior of the
> > busybox tftp client does not please my linux (RH7.2) tftp server. In
> > particular it looks like the server is expecting the client to ack the
> > last block of a tftp get request. If not it will try to resend the last
> > block until it gets and ICMP (unreachable) packet (because the client is
> > gone). Things ends well but there are some unnecessary retries and ICMP
> > packets.
> > 
> > I have done a quick hack in tftp.c to fix this and now my TFTP server is
> > quite happy.
> > 
> > So, to the people who know, is this a "bug"? If yes, are you interested
> > in my "fix"?
> > 
> > At least it should be noted that the actual behavior is not the one
> > expected by some TFTP servers (RH7.2).
> > 
> > Thanks for your time.
> > 
> > Regards
> > 
> > JC
> > 
> > --
> > Jean-Christophe Dubois <jdubois at mc.com>
> > Mercury Computer Systems
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://busybox.net/mailman/listinfo/busybox
-- 
Jean-Christophe Dubois <jdubois at mc.com>
Mercury Computer Systems



More information about the busybox mailing list