25141953 nping --icmp dumps core on SPARC s11u3-sru
authorRich Burridge <rich.burridge@oracle.com>
Fri, 14 Apr 2017 13:57:30 -0700
branchs11u3-sru
changeset 7870 ead51a0b55d0
parent 7869 a80ad5071d35
child 7871 144cb9bf676b
25141953 nping --icmp dumps core on SPARC
components/nmap/patches/nping-sparc-alignment.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/nmap/patches/nping-sparc-alignment.patch	Fri Apr 14 13:57:30 2017 -0700
@@ -0,0 +1,27 @@
+Fix alignment problems on SPARC. Based on similar fixes found at:
+
+  https://lists.debian.org/debian-sparc/2012/01/msg00012.html
+
+and:
+
+  https://www.winehq.org/pipermail/wine-patches/2011-February/098547.html
+
+This change needs to be sent upstream.
+
+--- nmap-6.25/nping/nping.cc.orig	2017-04-07 10:27:14.947958031 +0000
++++ nmap-6.25/nping/nping.cc	2017-04-07 10:27:41.119001212 +0000
+@@ -134,6 +134,14 @@
+   ProbeMode prob;
+   NpingTarget *t=NULL;
+ 
++/*
++ * 'ta 6' tells the kernel to synthesize any unaligned accesses this process
++ * makes, instead of just signalling an error and terminating the process.
++ */
++#ifdef __sparc
++    __asm("ta 6");
++#endif
++
+   /* Get current time */
+   now = time(NULL);
+   tm = localtime(&now);