[BACK]Return to ping.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sbin / ping

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sbin/ping/ping.c between version 1.102.6.3 and 1.102.6.4

version 1.102.6.3, 2013/06/23 06:28:52 version 1.102.6.4, 2014/08/20 00:02:27
Line 1011  pr_pack(u_char *buf,
Line 1011  pr_pack(u_char *buf,
         icp = (struct icmp *)(buf + hlen);          icp = (struct icmp *)(buf + hlen);
         if (icp->icmp_type == ICMP_ECHOREPLY          if (icp->icmp_type == ICMP_ECHOREPLY
             && icp->icmp_id == ident) {              && icp->icmp_id == ident) {
                 struct timespec tv;  
   
                 if (icp->icmp_seq == htons((u_int16_t)(ntransmitted-1)))                  if (icp->icmp_seq == htons((u_int16_t)(ntransmitted-1)))
                         lastrcvd = 1;                          lastrcvd = 1;
Line 1019  pr_pack(u_char *buf,
Line 1018  pr_pack(u_char *buf,
                 if (first_rx.tv_sec == 0)                  if (first_rx.tv_sec == 0)
                         first_rx = last_rx;                          first_rx = last_rx;
                 nreceived++;                  nreceived++;
                 if (pingflags & F_TIMING) {                  if (pingflags & (F_TIMING|F_TIMING64)) {
                         struct tv32 tv32;                          struct timespec tv;
   
                         (void) memcpy(&tv32, icp->icmp_data, sizeof(tv32));                          if (pingflags & F_TIMING) {
                         tv.tv_sec = (uint32_t)ntohl(tv32.tv32_sec);                                  struct tv32 tv32;
                         tv.tv_nsec = ntohl(tv32.tv32_usec) * 1000;  
                 } else if (pingflags & F_TIMING64)                                  (void)memcpy(&tv32, icp->icmp_data, sizeof(tv32));
                         (void) memcpy(&tv, icp->icmp_data, sizeof(tv));                                  tv.tv_sec = (uint32_t)ntohl(tv32.tv32_sec);
                                   tv.tv_nsec = ntohl(tv32.tv32_usec) * 1000;
                           } else if (pingflags & F_TIMING64)
                                   (void)memcpy(&tv, icp->icmp_data, sizeof(tv));
                           else
                                   memset(&tv, 0, sizeof(tv));     /* XXX: gcc */
   
                 if (pingflags & (F_TIMING|F_TIMING64)) {  
                         triptime = diffsec(&last_rx, &tv);                          triptime = diffsec(&last_rx, &tv);
                         tsum += triptime;                          tsum += triptime;
                         tsumsq += triptime * triptime;                          tsumsq += triptime * triptime;

Legend:
Removed from v.1.102.6.3  
changed lines
  Added in v.1.102.6.4

CVSweb <webmaster@jp.NetBSD.org>