mirror of
git://erdgeist.org/opentracker
synced 2025-01-11 15:30:07 +00:00
Do not lock out well behaving clients
This commit is contained in:
parent
cac5a31d93
commit
cc47504af2
5
ot_udp.c
5
ot_udp.c
@ -57,15 +57,16 @@ void handle_udp4( int64 serversocket ) {
|
||||
if( r < 16 )
|
||||
return;
|
||||
|
||||
switch( ntohl( inpacket[2] ) ) {
|
||||
case 0: /* This is a connect action */
|
||||
/* look for udp bittorrent magic id */
|
||||
if( (ntohl(inpacket[0]) != 0x00000417) || (ntohl(inpacket[1]) != 0x27101980) )
|
||||
return;
|
||||
|
||||
switch( ntohl( inpacket[2] ) ) {
|
||||
case 0: /* This is a connect action */
|
||||
outpacket[0] = 0;
|
||||
outpacket[1] = inpacket[3];
|
||||
udp_make_connectionid( outpacket + 2, remoteip );
|
||||
|
||||
socket_send4( serversocket, static_outbuf, 16, remoteip, remoteport );
|
||||
stats_issue_event( EVENT_CONNECT, 0, 16 );
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user