summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2c00e09)
raw | patch | inline | side by side (parent: 2c00e09)
author | Joe Hershberger <joe.hershberger@ni.com> | |
Wed, 23 May 2012 07:59:20 +0000 (07:59 +0000) | ||
committer | Joe Hershberger <joe.hershberger@ni.com> | |
Wed, 23 May 2012 22:53:05 +0000 (17:53 -0500) |
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>
(such as ping)
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
net/arp.c | patch | blob | history | |
net/ping.c | patch | blob | history |
diff --git a/net/arp.c b/net/arp.c
index 8cc175a7d4393f5cdb5972acf6af81c10b9b4b16..b2993eca5c56425f3f55b237e5b2e443cbe22323 100644 (file)
--- a/net/arp.c
+++ b/net/arp.c
case ARPOP_REPLY: /* arp reply */
/* are we waiting for a reply */
- if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC)
+ if (!NetArpWaitPacketIP)
break;
#ifdef CONFIG_KEEP_SERVERADDR
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);
diff --git a/net/ping.c b/net/ping.c
index 71246de5ff87965a9474fc0565b31d73c28617d5..068aa96a74f27aa1e5f76ed2ac8863b4c5557bb7 100644 (file)
--- a/net/ping.c
+++ b/net/ping.c
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);