]>
Commit | Line | Data |
---|---|---|
0fb5f2d4 JB |
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 | |
3 | @@ -169,7 +169,7 @@ | |
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); | |
10 | if (payload) { | |
11 | if (len > MAX_PAYLOAD) | |
12 | @@ -204,7 +204,7 @@ | |
13 | struct iphdr *ip = NULL; | |
14 | struct icmphdr *icmp = NULL; | |
15 | static char *pkt = NULL; | |
16 | - struct timeval now; | |
17 | + struct timeval now, pkttv; | |
18 | icmpEchoData *echo; | |
19 | static pingerReplyData preply; | |
20 | ||
21 | @@ -242,7 +242,8 @@ | |
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); |