Author: qboosh Date: Fri Mar 4 22:15:15 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- try to deal with misalignments
---- Files affected:
SOURCES:
squid-align.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/squid-align.patch
diff -u /dev/null SOURCES/squid-align.patch:1.1
--- /dev/null Fri Mar 4 23:15:15 2005
+++ SOURCES/squid-align.patch Fri Mar 4 23:15:10 2005
@@ -0,0 +1,30 @@
+--- 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);
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit