Details
Description
Found via unit test + a random luck that the IPs returned by localhost look up via net.LookupIP happens to return ipv4 in front of ipv6 address.
Essentially if the golang call of net.LookupIP returns addresses in a list and the IPv4 address is in the front of the list, and IPv6 only mode is in place, XDCR will return an invalid IPv6 address of:
[127.0.0.1]
============== Test case start: TestEnforceIP =================
|
NEIL DEBUG nonActive activeHostName connStr localhost
|
NEIL DEBUG addrs [127.0.0.1 ::1]
|
NEIL DEBUG ipv6 addr connStr localhost port 0 portErr No port number
|
NEIL DEBUG ipv4 blocked true ipv6 blocked false mapping connStr localhost isFullEncryption false to [127.0.0.1]
|
============== Test case done: TestEnforceIP =================
|
--- FAIL: TestEnforceIP (0.00s)
|
remote_cluster_ref_test.go:331:
|
Error Trace: remote_cluster_ref_test.go:331
|
Error: Not equal:
|
expected: "[::1]"
|
actual : "[127.0.0.1]"
|
|
Diff:
|
--- Expected
|
+++ Actual
|
@@ -1 +1 @@
|
-[::1]
|
+[127.0.0.1]
|
Test: TestEnforceIP
|
We haven't seen this in the field yet probably because not many people are using IPv6 only mode, and considering that Capella currently uses IPv4 only mode.
However, if IPv6 only mode is ever used, this could lead to continuous HA outages as the MyConnectionStr() method is used throughout the code as a remote cluster reference string getter.
Attachments
Issue Links
For Gerrit Dashboard: MB-57411 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
192683,2 | MB-57411: ipv6 only mode could return invalid IPv6 address | master | goxdcr | Status: MERGED | +2 | +1 |