Browse code

tls: use proper start of ipv6 address in tls.cfg

- reported by Anthony Messina

Daniel-Constantin Mierla authored on 23/02/2015 10:23:53
Showing 1 changed files
... ...
@@ -52,13 +52,13 @@ static int parse_ipv6(struct ip_addr* ip, cfg_token_t* token,
52 52
 	struct ip_addr* ipv6;
53 53
 	str ip6_str;
54 54
 
55
+	ip6_str.s = t.val.s;
55 56
 	while(1) {
56 57
 		ret = cfg_get_token(&t, st, 0);
57 58
 		if (ret != 0) goto err;
58 59
 		if (t.type == ']') break;
59 60
 		if (t.type != CFG_TOKEN_ALPHA && t.type != ':') goto err;
60 61
 	}
61
-	ip6_str.s = t.val.s;
62 62
 	ip6_str.len = (int)(long)(t.val.s - ip6_str.s);
63 63
 
64 64
 	ipv6 = str2ip6(&ip6_str);