bugGNU GRUB - Bugs: bug #40293, tftp implementation doesn't...


You are not allowed to post comments on this tracker with your current authentication level.

bug #40293: tftp implementation doesn't re-transmit ACKs

Submitted by:  Tyson Whitehead <twhitehead>
Submitted on:  Thu 17 Oct 2013 06:41:26 PM UTC  
Category:  Network Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release: 
Release:  Bazaar - trunk Reproducibility:  None
Planned Release:  None

Fri 15 Nov 2013 08:50:07 PM UTC, comment #3:

I finished testing your patch and am pleased to report it works.

Thanks! -Tyson

Tyson Whitehead <twhitehead>
Sun 27 Oct 2013 06:17:38 PM UTC, comment #2:

I committed a fix.

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 26 Oct 2013 02:03:25 AM UTC, comment #1:

Please try:
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
index b9d9549..2a01f1d 100644
--- a/grub-core/net/tftp.c
+++ b/grub-core/net/tftp.c
@@ -215,6 +215,7 @@ tftp_receive (grub_net_udp_socket_t sock _attribute_ ((unused)),
tftph = (struct tftphdr *) nb_top->data;
if (grub_be_to_cpu16 (tftph->u.data.block) >= data->block + 1)
+ ack (data, grub_be_to_cpu16 (tftph->u.data.block));
grub_netbuff_free (nb_top);
grub_priority_queue_pop (data->pq);

Vladimir Serbinenko <phcoder>
Project Administrator
Thu 17 Oct 2013 06:41:26 PM UTC, original submission:

Description of problem:

Grub2's TFTP implementation does not send another ACK upon receiving the last data packet a second time. This results in the TFTP transfer breaking down in the face of packet loss and ending in a timeout error. This looks like so

server -> data 1 -> grub
grub -> ack 1 -> server
server -> data 2 -> grub
grub -> ack 2 -> server
server -> data k -> grub
grub -> ack k -> (lost in the network)
server -> data k -> grub
server -> data k -> grub
server -> data k -> grub
server -> data k -> grub

until Grub reports a timeout error waiting for data k+1.

The relevant part of RFC 1350 is (Section 2 -- Overview)

"If a packet gets lost in the network, the intended recipient will timeout and may retransmit his last packet (which may be data or an acknowledgment), thus causing the sender of the lost packet to retransmit that lost packet.
Notice that both machines involved in a transfer are considered senders and receivers. One sends data and receives acknowledgments, the other sends acknowledgments and receives data."


I'm attaching a patch to get grub to re-transmit the last ack upon receiving the last data packet again. It works for me.

Tyson Whitehead <twhitehead>


Attached Files
file #29394:  tftp-ack.patch added by twhitehead (3KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by twhitehead (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-27 phcoder StatusNone => Fixed
        Open/ClosedOpen => Closed
    2013-10-17 twhitehead Attached File- => Added tftp-ack.patch, #29394

    Back to the top

    Powered by Savane 3.3