diff --git a/common/net/address.go b/common/net/address.go index 5993e907b..9ba8c4734 100644 --- a/common/net/address.go +++ b/common/net/address.go @@ -18,6 +18,9 @@ var ( // LocalHostIPv6 is a constant value for localhost IP in IPv6. LocalHostIPv6 = IPAddress([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}) + + // AnyIPv6 is a constant value for any IP in IPv6. + AnyIPv6 = IPAddress([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) ) // AddressFamily is the type of address. diff --git a/common/net/address_test.go b/common/net/address_test.go index 5c8ed57ba..8a4616307 100644 --- a/common/net/address_test.go +++ b/common/net/address_test.go @@ -84,6 +84,14 @@ func TestAddressProperty(t *testing.T) { String: "[2001:4860:0:2001::68]", }, }, + { + Input: ParseAddress("::0"), + Output: addrProprty{ + IP: AnyIPv6.IP(), + Family: AddressFamilyIPv6, + String: "[::]", + }, + }, { Input: ParseAddress("[::ffff:123.151.71.143]"), Output: addrProprty{