mirror of
git://erdgeist.org/opentracker
synced 2025-01-29 16:16:22 +00:00
Fixed parser error for v6 addresses
This commit is contained in:
parent
48f67314b6
commit
b1bf030f92
@ -327,10 +327,11 @@ static int scan_ip6_port( const char *src, ot_ip6 ip, uint16 *port ) {
|
|||||||
if( !(off = scan_ip6( s, ip ) ) )
|
if( !(off = scan_ip6( s, ip ) ) )
|
||||||
return 0;
|
return 0;
|
||||||
s += off;
|
s += off;
|
||||||
|
if( bracket && *s == ']' ) ++s;
|
||||||
if( *s == 0 || isspace(*s)) return s-src;
|
if( *s == 0 || isspace(*s)) return s-src;
|
||||||
if( *s == ']' && bracket ) ++s;
|
|
||||||
if( !ip6_isv4mapped(ip)){
|
if( !ip6_isv4mapped(ip)){
|
||||||
if( ( bracket && *(s) != ':' ) || ( *(s) != '.' ) ) return 0;
|
if( *s != ':' && *s != '.' ) return 0;
|
||||||
|
if( !bracket && *(s) == ':' ) return 0;
|
||||||
s++;
|
s++;
|
||||||
} else {
|
} else {
|
||||||
if( *(s++) != ':' ) return 0;
|
if( *(s++) != ':' ) return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user