1 --- squid-2.5.STABLE8/src/pinger.c.orig 2003-12-23 01:55:57.000000000 +0100
2 +++ squid-2.5.STABLE8/src/pinger.c 2005-03-04 23:13:15.000000000 +0100
4 icmp->icmp_seq = (u_short) icmp_pkts_sent++;
5 echo = (icmpEchoData *) (icmp + 1);
6 echo->opcode = (unsigned char) opcode;
7 - echo->tv = current_time;
8 + memcpy(&(echo->tv), ¤t_time, sizeof(struct timeval)); /* misaligned on archs with 64-bit time_t */
9 icmp_pktsize += sizeof(struct timeval) + sizeof(char);
11 if (len > MAX_PAYLOAD)
13 struct iphdr *ip = NULL;
14 struct icmphdr *icmp = NULL;
15 static char *pkt = NULL;
17 + struct timeval now, pkttv;
19 static pingerReplyData preply;
22 preply.from = from.sin_addr;
23 preply.opcode = echo->opcode;
24 preply.hops = ipHops(ip->ip_ttl);
25 - preply.rtt = tvSubMsec(echo->tv, now);
26 + memcpy(&pkttv, &(echo->tv), sizeof(struct timeval)); /* possibly misaligned */
27 + preply.rtt = tvSubMsec(pkttv, now);
28 preply.psize = n - iphdrlen - (sizeof(icmpEchoData) - MAX_PKT_SZ);
29 pingerSendtoSquid(&preply);
30 pingerLog(icmp, from.sin_addr, preply.rtt, preply.hops);