summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-05-03 17:21:32 -0700
committerJosh Blum <josh@joshknows.com>2010-05-03 17:21:32 -0700
commit2780e2cff074a8f1e476fe301f490a7fca0a3ee0 (patch)
tree05ece20318bcad41fd10e9099b6de73264fbf883
parentbe97b68ba230e16b513e5a0310aded49f4b2dcb4 (diff)
downloaduhd-2780e2cff074a8f1e476fe301f490a7fca0a3ee0.tar.gz
uhd-2780e2cff074a8f1e476fe301f490a7fca0a3ee0.tar.bz2
uhd-2780e2cff074a8f1e476fe301f490a7fca0a3ee0.zip
added icmp echo reply to usrp2
-rw-r--r--firmware/microblaze/lib/net_common.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c
index 67a3ff964..6c9509c92 100644
--- a/firmware/microblaze/lib/net_common.c
+++ b/firmware/microblaze/lib/net_common.c
@@ -303,7 +303,24 @@ handle_icmp_packet(struct ip_addr src, struct ip_addr dst,
}
break;
- case ICMP_ECHO:
+ case ICMP_ECHO:{
+ struct icmp_echo_hdr echo_reply;
+ echo_reply.type = 0;
+ echo_reply.code = 0;
+ echo_reply.chksum = 0;
+ echo_reply.id = icmp->id;
+ echo_reply.seqno = icmp->seqno;
+ echo_reply.chksum = ~chksum_buffer(
+ (unsigned short *)&echo_reply,
+ sizeof(echo_reply)/sizeof(short),
+ 0);
+ send_ip_pkt(
+ src, IP_PROTO_ICMP, &echo_reply, sizeof(echo_reply),
+ ((uint8_t*)icmp) + sizeof(struct icmp_echo_hdr),
+ len - sizeof(struct icmp_echo_hdr)
+ );
+ break;
+ }
default:
break;
}