components/nmap/patches/nping-sparc-alignment.patch
changeset 7843 56b5a2b1ab27
equal deleted inserted replaced
7842:d4c93736cade 7843:56b5a2b1ab27
       
     1  alignment problems on SPARC. Based on similar fixes found at:
       
     2 
       
     3   https://lists.debian.org/debian-sparc/2012/01/msg00012.html
       
     4 
       
     5 and:
       
     6 
       
     7   https://www.winehq.org/pipermail/wine-patches/2011-February/098547.html
       
     8 
       
     9 This change needs to be sent upstream.
       
    10 
       
    11 --- nmap-7.11/nping/nping.cc.orig	2017-04-06 11:17:11.026808836 +0000
       
    12 +++ nmap-7.11/nping/nping.cc	2017-04-06 11:17:36.219605075 +0000
       
    13 @@ -164,6 +164,14 @@
       
    14    ProbeMode prob;
       
    15    NpingTarget *t=NULL;
       
    16  
       
    17 +/*
       
    18 + * 'ta 6' tells the kernel to synthesize any unaligned accesses this process
       
    19 + * makes, instead of just signalling an error and terminating the process.
       
    20 + */
       
    21 +#ifdef __sparc
       
    22 +    __asm("ta 6");
       
    23 +#endif
       
    24 +
       
    25    /* Get current time */
       
    26    now = time(NULL);
       
    27    tm = localtime(&now);