mirror of
git://erdgeist.org/opentracker
synced 2025-01-13 00:10:08 +00:00
some 64bit and endianess issues with udp...
This commit is contained in:
parent
e75c3e25cd
commit
c00c64f9da
@ -584,7 +584,8 @@ static void handle_udp4( int64 serversocket ) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
numwant = 200;
|
numwant = 200;
|
||||||
left = ntohl( inpacket[64/4] );
|
/* We do only want to know, if it is zero */
|
||||||
|
left = inpacket[64/4] | inpacket[68/4];
|
||||||
event = ntohl( inpacket[80/4] );
|
event = ntohl( inpacket[80/4] );
|
||||||
port = ntohs( *(unsigned short*)( static_inbuf + 96 ) );
|
port = ntohs( *(unsigned short*)( static_inbuf + 96 ) );
|
||||||
hash = (ot_hash*)( static_inbuf + 16 );
|
hash = (ot_hash*)( static_inbuf + 16 );
|
||||||
@ -608,7 +609,7 @@ static void handle_udp4( int64 serversocket ) {
|
|||||||
/* Create fake packet to satisfy parser on the other end */
|
/* Create fake packet to satisfy parser on the other end */
|
||||||
outpacket[0] = htonl( 1 );
|
outpacket[0] = htonl( 1 );
|
||||||
outpacket[1] = inpacket[12/4];
|
outpacket[1] = inpacket[12/4];
|
||||||
outpacket[2] = OT_CLIENT_REQUEST_INTERVAL_RANDOM;
|
outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
|
||||||
outpacket[3] = outpacket[4] = 0;
|
outpacket[3] = outpacket[4] = 0;
|
||||||
socket_send4( serversocket, static_outbuf, 20, remoteip, port );
|
socket_send4( serversocket, static_outbuf, 20, remoteip, port );
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user