summaryrefslogtreecommitdiff
path: root/ot_udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_udp.c')
-rw-r--r--ot_udp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ot_udp.c b/ot_udp.c
index 7915528..ad389e3 100644
--- a/ot_udp.c
+++ b/ot_udp.c
@@ -57,6 +57,8 @@ void handle_udp4( int64 serversocket ) {
57 if( r < 16 ) 57 if( r < 16 )
58 return; 58 return;
59 59
60 fprintf( stderr, "UDP Connection id: %16llX\n", *(uint64_t*)inpacket );
61
60 switch( ntohl( inpacket[2] ) ) { 62 switch( ntohl( inpacket[2] ) ) {
61 case 0: /* This is a connect action */ 63 case 0: /* This is a connect action */
62 /* look for udp bittorrent magic id */ 64 /* look for udp bittorrent magic id */
@@ -76,7 +78,7 @@ void handle_udp4( int64 serversocket ) {
76 return; 78 return;
77 79
78 if( !udp_test_connectionid( inpacket, remoteip )) 80 if( !udp_test_connectionid( inpacket, remoteip ))
79 fprintf( stderr, "UDP Connection id missmatch, %16llX\n", *(uint64_t*)inpacket ); 81 fprintf( stderr, "UDP Connection id missmatch.\n" );
80 82
81 numwant = 200; 83 numwant = 200;
82 /* We do only want to know, if it is zero */ 84 /* We do only want to know, if it is zero */
@@ -118,7 +120,7 @@ void handle_udp4( int64 serversocket ) {
118 120
119 case 2: /* This is a scrape action */ 121 case 2: /* This is a scrape action */
120 if( !udp_test_connectionid( inpacket, remoteip )) 122 if( !udp_test_connectionid( inpacket, remoteip ))
121 fprintf( stderr, "UDP Connection id missmatch, %16llX\n", *(uint64_t*)inpacket ); 123 fprintf( stderr, "UDP Connection id missmatch.\n" );
122 124
123 outpacket[0] = htonl( 2 ); /* scrape action */ 125 outpacket[0] = htonl( 2 ); /* scrape action */
124 outpacket[1] = inpacket[12/4]; 126 outpacket[1] = inpacket[12/4];