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

Submitter:  Tyson Whitehead <twhitehead>
Submitted:  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:  Bazaar - trunk
Release:  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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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.13-f8d8.
    Corresponding source code