summaryrefslogtreecommitdiff
path: root/net/ping.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ping.c')
-rw-r--r--net/ping.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ping.c b/net/ping.c
index 3e5461a36a..821d35d01d 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -84,6 +84,7 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src;
struct in_addr src_ip;
int eth_hdr_size;
+ uchar *tx_packet;
switch (icmph->type) {
case ICMP_ECHO_REPLY:
@@ -107,8 +108,10 @@ 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);
- memcpy(net_tx_packet, et, eth_hdr_size + len);
- net_send_packet(net_tx_packet, eth_hdr_size + len);
+
+ tx_packet = net_get_async_tx_pkt_buf();
+ memcpy(tx_packet, et, eth_hdr_size + len);
+ net_send_packet(tx_packet, eth_hdr_size + len);
return;
/* default:
return;*/