TFTP'ing a file of size 1747851 bytes with CONFIG_IP_DEFRAG and CONFIG_TFTP_BLOCKSIZE set to 4096 fails with a timeout, because the last fragment is not taken into account. This patch fixes IP fragments having less than 8 bytes of payload.
Signed-off-by: Stephane Fillod <stephane.fil...@grassvalley.com> Acked-by: Alessandro Rubini <rub...@gnudd.com> --- Many thanks to Alessandro for the explanation and the better suggestion. PS: Sorry for my stinky MUA breaking References: field :-( --- a/net/net.c 31 Mar 2010 21:54:39 +++ b/net/net.c 11 Jun 2010 15:36:37 @@ -1201,7 +1201,8 @@ static IP_t *__NetDefragment(IP_t *ip, i h = payload + h->next_hole; } - if (offset8 + (len / 8) <= h - payload) { + /* last fragment may be 1..7 bytes, the "+7" forces acceptance */ + if (offset8 + ((len + 7) / 8) <= h - payload) { /* no overlap with holes (dup fragment?) */ return NULL; } _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot