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

 
 

You are not allowed to post comments on this tracker with your current authentification 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: NetworkSeverity: Major
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Bazaar - trunkReproducibility: 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)
break;
+ 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."

http://www.ietf.org/rfc/rfc1350.txt

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 (3kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Oct 2013 06:17:38 PM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 17 Oct 2013 06:41:26 PM UTCtwhiteheadAttached File-=>Added tftp-ack.patch, #29394

    Back to the top


    Powered by Savane 3.1-cleanup