summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordenis <>2007-06-06 16:45:48 +0000
committerdenis <>2007-06-06 16:45:48 +0000
commit78b7c73eab3b7597e37ce581981fd1b02d7c98f1 (patch)
treecff38558c602ea9d4e5952168b055092693ceb79
parentf3d83559e61f6aa413cf52b5c39ede837513f83d (diff)
check for mafic udp id
-rw-r--r--opentracker.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c
index ecc2c9c..36fa989 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -614,6 +614,10 @@ static void handle_udp4( int64 serversocket ) {
614 if( r < 16 ) 614 if( r < 16 )
615 return; 615 return;
616 616
617 /* look for udp bittorrent magic id */
618 if( (ntohl(inpacket[0]) != 0x00000417) || (ntohl(inpacket[1]) != 0x27101980) )
619 return;
620
617 switch( ntohl( inpacket[2] ) ) { 621 switch( ntohl( inpacket[2] ) ) {
618 case 0: /* This is a connect action */ 622 case 0: /* This is a connect action */
619 outpacket[0] = 0; outpacket[1] = inpacket[3]; 623 outpacket[0] = 0; outpacket[1] = inpacket[3];