From 78b7c73eab3b7597e37ce581981fd1b02d7c98f1 Mon Sep 17 00:00:00 2001 From: denis <> Date: Wed, 6 Jun 2007 16:45:48 +0000 Subject: check for mafic udp id --- opentracker.c | 4 ++++ 1 file changed, 4 insertions(+) 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 ) { if( r < 16 ) return; + /* 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]; -- cgit v1.2.3