diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 07:59:20 +0000 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 17:53:05 -0500 |
commit | f1d2d2846988b21a4df6697fdac08999034d3027 (patch) | |
tree | c6179ceeb6da4a09675c8d8e7daf372ca8996773 /net/arp.c | |
parent | 2c00e099fe77b014dd094a49113e2c6ce8a24a16 (diff) | |
download | u-boot-imx-f1d2d2846988b21a4df6697fdac08999034d3027.zip u-boot-imx-f1d2d2846988b21a4df6697fdac08999034d3027.tar.gz u-boot-imx-f1d2d2846988b21a4df6697fdac08999034d3027.tar.bz2 |
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/arp.c')
-rw-r--r-- | net/arp.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -170,7 +170,7 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) case ARPOP_REPLY: /* arp reply */ /* are we waiting for a reply */ - if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) + if (!NetArpWaitPacketIP) break; #ifdef CONFIG_KEEP_SERVERADDR @@ -189,15 +189,16 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) arp->ar_data); /* save address for later use */ - memcpy(NetArpWaitPacketMAC, - &arp->ar_sha, ARP_HLEN); + if (NetArpWaitPacketMAC != NULL) + memcpy(NetArpWaitPacketMAC, + &arp->ar_sha, ARP_HLEN); net_get_arp_handler()((uchar *)arp, 0, reply_ip_addr, 0, len); /* modify header, and transmit it */ memcpy(((struct ethernet_hdr *)NetArpWaitTxPacket)-> - et_dest, NetArpWaitPacketMAC, ARP_HLEN); + et_dest, &arp->ar_sha, ARP_HLEN); NetSendPacket(NetArpWaitTxPacket, NetArpWaitTxPacketSize); |