From b1bf030f922685b2613c7826fac306b6c2a82552 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Thu, 5 Nov 2009 20:20:48 +0000 Subject: [PATCH] Fixed parser error for v6 addresses --- opentracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opentracker.c b/opentracker.c index c16b360..9cdc68e 100644 --- a/opentracker.c +++ b/opentracker.c @@ -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;