]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Fix endianess issue in /24 stats code
authorerdgeist <>
Sun, 22 Jul 2007 16:33:16 +0000 (16:33 +0000)
committererdgeist <>
Sun, 22 Jul 2007 16:33:16 +0000 (16:33 +0000)
trackerlogic.c

index ee49eb784b5ef0285d0a752f1791d78856627eba..9294ec495cc670c70b2ef68bbf80435c6c518a97 100644 (file)
@@ -656,8 +656,8 @@ size_t return_stats_for_slash24s( char *reply, size_t amount, ot_dword thresh )
         ot_peer *peers =    peer_list->peers[k].data;
         size_t   numpeers = peer_list->peers[k].size;
         for( l=0; l<numpeers; ++l )
-          if( ++count[ (*(ot_dword*)(peers+l))>>8 ] == 65335 )
-            count[ (*(ot_dword*)(peers+l))>>8 ] = 65334;
+          if( ++count[ ntohl(*(ot_dword*)(peers+l))>>8 ] == 65335 )
+            count[ ntohl(*(ot_dword*)(peers+l))>>8 ] = 65334;
       }
     }
   }