aboutsummaryrefslogtreecommitdiff
path: root/net/ping.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 07:59:20 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:53:05 -0500
commitf1d2d2846988b21a4df6697fdac08999034d3027 (patch)
treec6179ceeb6da4a09675c8d8e7daf372ca8996773 /net/ping.c
parent2c00e099fe77b014dd094a49113e2c6ce8a24a16 (diff)
downloadu-boot-linaro-stable-f1d2d2846988b21a4df6697fdac08999034d3027.tar.gz
net: Remove static allocation for MAC address in PingSend()
Don't force ARP clients to return the MAC address if they don't care (such as ping) Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'net/ping.c')
-rw-r--r--net/ping.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/ping.c b/net/ping.c
index 71246de5f..068aa96a7 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -40,22 +40,18 @@ static void set_icmp_header(uchar *pkt, IPaddr_t dest)
static int ping_send(void)
{
- static uchar mac[6];
uchar *pkt;
int eth_hdr_size;
/* XXX always send arp request */
- memcpy(mac, NetEtherNullAddr, 6);
-
debug("sending ARP for %pI4\n", &NetPingIP);
NetArpWaitPacketIP = NetPingIP;
- NetArpWaitPacketMAC = mac;
- pkt = NetArpWaitTxPacket;
- eth_hdr_size = NetSetEther(pkt, mac, PROT_IP);
- pkt += eth_hdr_size;
+ eth_hdr_size = NetSetEther(NetArpWaitTxPacket, NetEtherNullAddr,
+ PROT_IP);
+ pkt = NetArpWaitTxPacket + eth_hdr_size;
set_icmp_header(pkt, NetPingIP);