[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Send tftp ack packet before closing the socket
From: |
Paulo Flabiano Smorigo/Brazil/IBM |
Subject: |
[PATCH] Send tftp ack packet before closing the socket |
Date: |
Wed, 14 Aug 2013 09:55:52 -0400 |
User-agent: |
Internet Messaging Program (IMP) H4 (5.0.22) |
Hi all,
This is another patch from Avik Sil. Bellow are the bug explanation:
I found another grub bug in tftp transfer. The issue comes for a
subtle corner case.
While grub sends tftp acks, it maintains a 'count' variable that is
incremented on each data packet received from tftp server. On every
data packet received, if 'count' is less than 50, it
sends an ack, otherwise it wont. So for this '50'th packet the ack is
sent by another function 'tftp_packets_pulled' that is called later
from net read routine through a function pointer.
When the last block of a file is received as a data packet it is
verified that it's the last block and the socket is closed.
Now there is a corner case. In case the last block happens to be that
'50'th block the ack is not sent (as usual) and the socket is closed.
Afterwards, when the net read routine calls 'tftp_packets_pulled' it
tries to send the ack using that closed socket, resulting in failure
in sending the ack packet! This happened to be the case for the
vmlinuz file I'm trying to load.
The attached patch fixes this issue by checking if the ack packet is
already sent before closing the packet; if not sent call the ack
routine.
--
Paulo Flabiano Smorigo
Software Engineer
Linux Technology Center - IBM Systems & Technology Group
grub_send_tftp_ack_packet.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Send tftp ack packet before closing the socket,
Paulo Flabiano Smorigo/Brazil/IBM <=