diff options
author | erdgeist <> | 2008-02-05 01:55:06 +0000 |
---|---|---|
committer | erdgeist <> | 2008-02-05 01:55:06 +0000 |
commit | cadf1803e1b36866a9f8a0e57d3b741360928928 (patch) | |
tree | d6ade7eba9f2886a59c1765880e20e0cf3d03f67 /ot_udp.c | |
parent | 90184649d021120c1b181bc6a6fe602802a17ef4 (diff) |
Fix endianess issues, also obey number of peers requested in udp announces
Diffstat (limited to 'ot_udp.c')
-rw-r--r-- | ot_udp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -84,10 +84,12 @@ void handle_udp4( int64 serversocket ) { | |||
84 | /* if( !udp_test_connectionid( inpacket, remoteip )) | 84 | /* if( !udp_test_connectionid( inpacket, remoteip )) |
85 | fprintf( stderr, "UDP Connection id missmatch.\n" ); */ | 85 | fprintf( stderr, "UDP Connection id missmatch.\n" ); */ |
86 | 86 | ||
87 | numwant = 200; | ||
88 | /* We do only want to know, if it is zero */ | 87 | /* We do only want to know, if it is zero */ |
89 | left = inpacket[64/4] | inpacket[68/4]; | 88 | left = inpacket[64/4] | inpacket[68/4]; |
90 | 89 | ||
90 | numwant = ntohl( inpacket[92/4] ); | ||
91 | if (numwant > 200) numwant = 200; | ||
92 | |||
91 | event = ntohl( inpacket[80/4] ); | 93 | event = ntohl( inpacket[80/4] ); |
92 | port = *(uint16_t*)( static_inbuf + 96 ); | 94 | port = *(uint16_t*)( static_inbuf + 96 ); |
93 | hash = (ot_hash*)( static_inbuf + 16 ); | 95 | hash = (ot_hash*)( static_inbuf + 16 ); |