if (h->saddr.ss_family == AF_INET && socket4 >= 0) {
if(icmp_request_typ == 13)
- proto = 13;
+ proto = ICMP_TSTAMP;
n = socket_sendto_ping_ipv4(socket4, (struct sockaddr *)&h->saddr, h->saddr_len, myseq, ident4, proto);
}
#ifdef IPV6
icp = (struct icmp *)(reply_buf + hlen);
- if (icp->icmp_type != ICMP_ECHOREPLY && icp->icmp_type != 14) {
+ if (icp->icmp_type != ICMP_ECHOREPLY && icp->icmp_type != ICMP_TSTAMPREPLY) {
/* Handle other ICMP packets */
struct icmp *sent_icmp;
SEQMAP_VALUE *seqmap_value;
sent_icmp = (struct icmp *)(reply_buf + hlen + ICMP_MINLEN + sizeof(struct ip));
- if ((sent_icmp->icmp_type != ICMP_ECHO && sent_icmp->icmp_type != 13) || sent_icmp->icmp_id != ident4) {
+ if ((sent_icmp->icmp_type != ICMP_ECHO && sent_icmp->icmp_type != ICMP_TSTAMP) || sent_icmp->icmp_id != ident4) {
/* not caused by us */
return -1;
}
*id = icp->icmp_id;
*seq = ntohs(icp->icmp_seq);
- if(icp->icmp_type == 14) {
+ if(icp->icmp_type == ICMP_TSTAMPREPLY) {
*ip_header_otime_ms = ntohl(icp->icmp_dun.id_ts.its_otime);
*ip_header_rtime_ms = ntohl(icp->icmp_dun.id_ts.its_rtime);
*ip_header_ttime_ms = ntohl(icp->icmp_dun.id_ts.its_ttime);
icp = (struct icmp*)ping_buffer_ipv4;
icp->icmp_type = icmp_proto;
- if(icmp_proto == 13) {
+ if(icmp_proto == ICMP_TSTAMP) {
clock_gettime(CLOCK_REALTIME, &tsorig);
tsorig_ms = (tsorig.tv_sec % (24*60*60)) * 1000 + tsorig.tv_nsec / 1000000;
icp->icmp_otime = htonl(tsorig_ms);