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>
This commit is contained in:
Joe Hershberger
2012-05-23 07:59:20 +00:00
parent 2c00e099fe
commit f1d2d28469
2 changed files with 8 additions and 11 deletions
+3 -7
View File
@@ -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);