diff options
author | Mario Six <mario.six@gdsys.cc> | 2018-03-28 14:38:49 +0200 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-06-13 13:54:15 -0500 |
commit | 2d8f25ed7b3626930b9fc950b20a1ec0be7abbe9 (patch) | |
tree | 28655ef670fc63979021c9c803228f3f527d4446 /net | |
parent | acaee30608ce203289a180d664b7f0abb2e64ee7 (diff) | |
download | u-boot-2d8f25ed7b3626930b9fc950b20a1ec0be7abbe9.tar.gz |
net: Always align tx packets
Make sure that TX packets are always cache-aligned.
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/arp.c | 3 | ||||
-rw-r--r-- | net/ping.c | 3 |
2 files changed, 4 insertions, 2 deletions
@@ -182,7 +182,8 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) (net_read_ip(&arp->ar_spa).s_addr & net_netmask.s_addr)) udelay(5000); #endif - net_send_packet((uchar *)et, eth_hdr_size + ARP_HDR_SIZE); + memcpy(net_tx_packet, et, eth_hdr_size + ARP_HDR_SIZE); + net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE); return; case ARPOP_REPLY: /* arp reply */ diff --git a/net/ping.c b/net/ping.c index 5464f2f785..3e5461a36a 100644 --- a/net/ping.c +++ b/net/ping.c @@ -107,7 +107,8 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) icmph->type = ICMP_ECHO_REPLY; icmph->checksum = 0; icmph->checksum = compute_ip_checksum(icmph, len - IP_HDR_SIZE); - net_send_packet((uchar *)et, eth_hdr_size + len); + memcpy(net_tx_packet, et, eth_hdr_size + len); + net_send_packet(net_tx_packet, eth_hdr_size + len); return; /* default: return;*/ |