diff options
Diffstat (limited to 'ot_udp.c')
-rw-r--r-- | ot_udp.c | 14 |
1 files changed, 0 insertions, 14 deletions
@@ -27,14 +27,6 @@ static void udp_make_connectionid( uint32_t * connid, const ot_ip6 remoteip ) { | |||
27 | memcpy( connid, g_static_connid, 8 ); | 27 | memcpy( connid, g_static_connid, 8 ); |
28 | } | 28 | } |
29 | 29 | ||
30 | static int udp_test_connectionid( const uint32_t * const connid, const ot_ip6 remoteip ) { | ||
31 | /* Touch unused variable */ | ||
32 | (void)remoteip; | ||
33 | |||
34 | /* Test against our static secret */ | ||
35 | return !memcmp( connid, g_static_connid, 8 ); | ||
36 | } | ||
37 | |||
38 | /* UDP implementation according to http://xbtt.sourceforge.net/udp_tracker_protocol.html */ | 30 | /* UDP implementation according to http://xbtt.sourceforge.net/udp_tracker_protocol.html */ |
39 | void handle_udp6( int64 serversocket, struct ot_workstruct *ws ) { | 31 | void handle_udp6( int64 serversocket, struct ot_workstruct *ws ) { |
40 | ot_peer peer; | 32 | ot_peer peer; |
@@ -73,9 +65,6 @@ void handle_udp6( int64 serversocket, struct ot_workstruct *ws ) { | |||
73 | if( byte_count < 98 ) | 65 | if( byte_count < 98 ) |
74 | return; | 66 | return; |
75 | 67 | ||
76 | if( !udp_test_connectionid( inpacket, remoteip )) | ||
77 | fprintf( stderr, "UDP connect Connection id missmatch.\n" ); | ||
78 | |||
79 | /* We do only want to know, if it is zero */ | 68 | /* We do only want to know, if it is zero */ |
80 | left = inpacket[64/4] | inpacket[68/4]; | 69 | left = inpacket[64/4] | inpacket[68/4]; |
81 | 70 | ||
@@ -112,9 +101,6 @@ void handle_udp6( int64 serversocket, struct ot_workstruct *ws ) { | |||
112 | break; | 101 | break; |
113 | 102 | ||
114 | case 2: /* This is a scrape action */ | 103 | case 2: /* This is a scrape action */ |
115 | if( !udp_test_connectionid( inpacket, remoteip )) | ||
116 | fprintf( stderr, "UDP scrape Connection id missmatch.\n" ); | ||
117 | |||
118 | outpacket[0] = htonl( 2 ); /* scrape action */ | 104 | outpacket[0] = htonl( 2 ); /* scrape action */ |
119 | outpacket[1] = inpacket[12/4]; | 105 | outpacket[1] = inpacket[12/4]; |
120 | 106 | ||