summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorerdgeist <>2007-03-13 22:19:03 +0000
committererdgeist <>2007-03-13 22:19:03 +0000
commitc00c64f9da894986c2b6bef0a4e3be33ad439103 (patch)
tree53544ed9ffd3a4c24d409b4c5f159f1e43050021 /opentracker.c
parente75c3e25cd1d33eecd8303f06365ae921141dfa6 (diff)
some 64bit and endianess issues with udp...
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/opentracker.c b/opentracker.c
index b4386c6..a83b276 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -584,7 +584,8 @@ static void handle_udp4( int64 serversocket ) {
584 return; 584 return;
585 585
586 numwant = 200; 586 numwant = 200;
587 left = ntohl( inpacket[64/4] ); 587 /* We do only want to know, if it is zero */
588 left = inpacket[64/4] | inpacket[68/4];
588 event = ntohl( inpacket[80/4] ); 589 event = ntohl( inpacket[80/4] );
589 port = ntohs( *(unsigned short*)( static_inbuf + 96 ) ); 590 port = ntohs( *(unsigned short*)( static_inbuf + 96 ) );
590 hash = (ot_hash*)( static_inbuf + 16 ); 591 hash = (ot_hash*)( static_inbuf + 16 );
@@ -608,7 +609,7 @@ static void handle_udp4( int64 serversocket ) {
608 /* Create fake packet to satisfy parser on the other end */ 609 /* Create fake packet to satisfy parser on the other end */
609 outpacket[0] = htonl( 1 ); 610 outpacket[0] = htonl( 1 );
610 outpacket[1] = inpacket[12/4]; 611 outpacket[1] = inpacket[12/4];
611 outpacket[2] = OT_CLIENT_REQUEST_INTERVAL_RANDOM; 612 outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
612 outpacket[3] = outpacket[4] = 0; 613 outpacket[3] = outpacket[4] = 0;
613 socket_send4( serversocket, static_outbuf, 20, remoteip, port ); 614 socket_send4( serversocket, static_outbuf, 20, remoteip, port );
614 } else { 615 } else {