OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../netkit-base/64bit-alignment.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. At least on sparc64 gcc optimized the memcpy into 2 32bit load/stores. However
  17. the data does not match that alignment requirements, the program receivees
  18. a SIGBUS. I'm not sure if this is a misoptimization bug in gcc ...
  19. - Rene Rebe <rene@exactcode.de>
  20. diff -ur netkit-base-0.17/ping/ping.c netkit-base-0.17-fixed/ping/ping.c
  21. --- netkit-base-0.17/ping/ping.c 2000-07-23 06:16:21.000000000 +0200
  22. +++ netkit-base-0.17-fixed/ping/ping.c 2005-01-29 17:53:55.000000000 +0100
  23. @@ -673,7 +673,7 @@
  24. {
  25. struct ip *ip;
  26. struct icmp *icp;
  27. - struct timeval now, packettv, *tp;
  28. + struct timeval now, packettv;
  29. long triptime = 0;
  30. int hlen, dupflag;
  31. int rv;
  32. @@ -722,8 +722,7 @@
  33. return 0; /* 'Twas not our ECHO */
  34. nreceived++;
  35. if (timing) {
  36. - tp = (struct timeval *)icp->icmp_data;
  37. - memcpy(&packettv, tp, sizeof(struct timeval));
  38. + memcpy( &packettv, icp->icmp_data, sizeof(struct timeval));
  39. tvsub(&now, &packettv);
  40. /* precision: tenths of milliseconds */