mbenkmann / limux-gosa

GOsa² is a web based adminstration tool for user accounts, groups, servers, clients, and many other things.
18 stars 5 forks source link

use IPv4 when multiple addresses returned #138

Closed mbenkmann closed 9 years ago

mbenkmann commented 9 years ago

From mux2...@gmail.com on August 19, 2013 12:24:52

On some machines "sibridge localhost" results in the error message "too many colons in address ::1:20081" whenever a command is issued. The culprit seems to be message/peer_connection.go:Peer() which uses LookupIP() and simply uses the first returned address. The same coding pattern occurs elsewhere I'm sure.

Fix this by creating a function util.Resolve(addr) which takes an addr with or without port and replaces the host part with its IP address. If an IPv4 address is available, it uses that. Otherwise it uses an IPv6 address properly encapsulated in square brackets [...].

Original issue: http://code.google.com/p/go-susi/issues/detail?id=138

mbenkmann commented 9 years ago

From matthias...@gmail.com on August 25, 2013 08:14:45

Done in 218477fbd5d7

Status: Done