update ipv6 comparison

pull/215/head
v2ray 2016-07-14 14:25:06 +02:00
parent 476b3c68d2
commit 6f998fa18b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 16 additions and 6 deletions

View File

@ -133,12 +133,22 @@ func (this *ipv6Address) Equals(another Address) bool {
if !ok { if !ok {
return false return false
} }
for idx, v := range *this { return this[0] == anotherIPv6[0] &&
if anotherIPv6[idx] != v { this[1] == anotherIPv6[1] &&
return false this[2] == anotherIPv6[2] &&
} this[3] == anotherIPv6[3] &&
} this[4] == anotherIPv6[4] &&
return true this[5] == anotherIPv6[5] &&
this[6] == anotherIPv6[6] &&
this[7] == anotherIPv6[7] &&
this[8] == anotherIPv6[8] &&
this[9] == anotherIPv6[9] &&
this[10] == anotherIPv6[10] &&
this[11] == anotherIPv6[11] &&
this[12] == anotherIPv6[12] &&
this[13] == anotherIPv6[13] &&
this[14] == anotherIPv6[14] &&
this[15] == anotherIPv6[15]
} }
type domainAddress string type domainAddress string