[U-Boot] [PATCH 0/1] Store waiting packet in a different buffer when making ARP requests

Tran Tien Dat peter.trantiendat at gmail.com
Wed Jul 4 05:15:37 UTC 2018


Hi,

This is my first email to U-Boot so please let me know if I am not doing it
correctly.

U-Boot has 1 buffer to send Ethernet frames, pointed to by net_tx_packet.
When sending to an IP address without knowing the MAC address, U-Boot makes
an ARP request to find out the MAC address of the IP address, and continue
sending the frame in the net_tx_packet after receiving a matching ARP
reply. However, in the mean time, if U-Boot needs to send out any network
packets (e.g. replying ping packets, etc.), the content of net_tx_packet
will be used to prepare the new packet. Thus it is no longer the packet
that is meant to be transmitted after the ARP reply.

U-Boot has another buffer, pointed to by arp_tx_packet which is used to
prepare ARP requests. ARP requests use this buffer instead of the normal
net_tx_packet in order to avoid modifying the waiting packet to be sent.
However, this approach does not prevent other part of the codes from
modifying the waiting packet to be sent, because net_tx_packet is a common
buffer used by all network protocol. This patch repurposes the
arp_tx_packet buffer to be used to store the waiting packet to be sent, and
use the normal net_tx_packet buffer to send ARP request instead.

Best Regards,
Dat



Tran Tien Dat (1):
  net: Store waiting packet in a different buffer when making ARP
    requests

 net/arp.c | 18 ++++++++++--------
 net/arp.h |  1 +
 net/net.c |  3 +++
 3 files changed, 14 insertions(+), 8 deletions(-)

-- 
2.18.0



More information about the U-Boot mailing list