Browse Source

Fixed parser error for v6 addresses

master
Dirk Engling 12 years ago
parent
commit
74df02abc7
  1. 9
      opentracker.c

9
opentracker.c

@ -2,7 +2,7 @@
It is considered beerware. Prost. Skol. Cheers or whatever.
Some of the stuff below is stolen from Fefes example libowfat httpd.
$Id: opentracker.c,v 1.224 2009/08/26 17:35:52 erdgeist Exp $ */
$Id: opentracker.c,v 1.225 2009/11/05 20:20:48 erdgeist Exp $ */
/* System */
#include <stdlib.h>
@ -327,10 +327,11 @@ static int scan_ip6_port( const char *src, ot_ip6 ip, uint16 *port ) {
if( !(off = scan_ip6( s, ip ) ) )
return 0;
s += off;
if( bracket && *s == ']' ) ++s;
if( *s == 0 || isspace(*s)) return s-src;
if( *s == ']' && bracket ) ++s;
if( !ip6_isv4mapped(ip)){
if( ( bracket && *(s) != ':' ) || ( *(s) != '.' ) ) return 0;
if( *s != ':' && *s != '.' ) return 0;
if( !bracket && *(s) == ':' ) return 0;
s++;
} else {
if( *(s++) != ':' ) return 0;
@ -592,4 +593,4 @@ int main( int argc, char **argv ) {
return 0;
}
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.224 $\n";
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.225 $\n";
Loading…
Cancel
Save