mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Fix IPv6 formatting in Candidate.String()
A Candidate with IPv6 address was formatted similar to fe80::1:51820 net.JoinHostPort will add [ ] around the address if it's IPv6, so it would look like [fe80::1]:51820 instead.
This commit is contained in:
+1
-1
@@ -344,7 +344,7 @@ func (c *candidateBase) Equal(other Candidate) bool {
|
||||
|
||||
// String makes the candidateBase printable
|
||||
func (c *candidateBase) String() string {
|
||||
return fmt.Sprintf("%s %s %s:%d%s", c.NetworkType(), c.Type(), c.Address(), c.Port(), c.relatedAddress)
|
||||
return fmt.Sprintf("%s %s %s%s", c.NetworkType(), c.Type(), net.JoinHostPort(c.Address(), strconv.Itoa(c.Port())), c.relatedAddress)
|
||||
}
|
||||
|
||||
// LastReceived returns a time.Time indicating the last time
|
||||
|
||||
Reference in New Issue
Block a user