--- squid-2.5.STABLE8/src/pinger.c.orig 2003-12-23 01:55:57.000000000 +0100 +++ squid-2.5.STABLE8/src/pinger.c 2005-03-04 23:13:15.000000000 +0100 @@ -169,7 +169,7 @@ icmp->icmp_seq = (u_short) icmp_pkts_sent++; echo = (icmpEchoData *) (icmp + 1); echo->opcode = (unsigned char) opcode; - echo->tv = current_time; + memcpy(&(echo->tv), ¤t_time, sizeof(struct timeval)); /* misaligned on archs with 64-bit time_t */ icmp_pktsize += sizeof(struct timeval) + sizeof(char); if (payload) { if (len > MAX_PAYLOAD) @@ -204,7 +204,7 @@ struct iphdr *ip = NULL; struct icmphdr *icmp = NULL; static char *pkt = NULL; - struct timeval now; + struct timeval now, pkttv; icmpEchoData *echo; static pingerReplyData preply; @@ -242,7 +242,8 @@ preply.from = from.sin_addr; preply.opcode = echo->opcode; preply.hops = ipHops(ip->ip_ttl); - preply.rtt = tvSubMsec(echo->tv, now); + memcpy(&pkttv, &(echo->tv), sizeof(struct timeval)); /* possibly misaligned */ + preply.rtt = tvSubMsec(pkttv, now); preply.psize = n - iphdrlen - (sizeof(icmpEchoData) - MAX_PKT_SZ); pingerSendtoSquid(&preply); pingerLog(icmp, from.sin_addr, preply.rtt, preply.hops);