From 65a4156b3493a50e4358d9bb6ed815cefb58d9b7 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 13 Dec 2019 11:09:04 +1100 Subject: [PATCH 1/2] ctdb-scripts: Strip square brackets when gathering connection info ss added square brackets around IPv6 addresses in versions > 4.12.0 via commit aba9c23a6e1cb134840c998df14888dca469a485. CentOS 7 added this feature somewhere mid-release. So, backward compatibility is obviously needed. As per the comment protocol/protocol_util.c should probably print and parse such square brackets. However, for backward compatibility the brackets would have to be stripped in both places in update_tickles()... or added to the ss output when missing. Best to leave this until we have a connection tracking daemon. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14227 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 693080abe4d8bec96280af5a6aa668251a98ec5d) --- ctdb/config/functions | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ctdb/config/functions b/ctdb/config/functions index 1dc16532890..2e9c3ef6bf0 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -977,10 +977,16 @@ update_tickles () _my_connections="${tickledir}/${_port}.connections.$$" # Parentheses are needed around the filters for precedence but # the parentheses can't be empty! + # + # Recent versions of ss print square brackets around IPv6 + # addresses. While it is desirable to update CTDB's address + # parsing and printing code, something needs to be done here + # for backward compatibility, so just delete the brackets. ss -tn state established \ "${_ip_filter:+( ${_ip_filter} )}" \ "${_port_filter:+( ${_port_filter} )}" | awk 'NR > 1 {print $4, $3}' | + tr -d '][' | sort >"$_my_connections" # Record our current tickles in a temporary file -- 2.24.1 From 3862c1a29afc0c8317a0a75d4562b879b0af6eb2 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 28 Nov 2019 14:00:58 +1100 Subject: [PATCH 2/2] ctdb-tests: Skip some tests that don't work with IPv6 See the comments added to the tests. It may be possible to rewrite these so they do something sane for IPv6... some other time. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14227 RN: Fix IPv6 issues (NFS connection tracking, tests) Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Fri Jan 3 00:00:55 UTC 2020 on sn-devel-184 (backported from commit 9edf15afc219a1a782ec1e4d29909361bbabc744) Signed-off-by: Martin Schwenke --- ctdb/tests/complex/60_rogueip_releaseip.sh | 10 ++++++++++ ctdb/tests/complex/61_rogueip_takeip.sh | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ctdb/tests/complex/60_rogueip_releaseip.sh b/ctdb/tests/complex/60_rogueip_releaseip.sh index 88e4e554c34..99d0d406e6f 100755 --- a/ctdb/tests/complex/60_rogueip_releaseip.sh +++ b/ctdb/tests/complex/60_rogueip_releaseip.sh @@ -21,6 +21,16 @@ select_test_node_and_ips echo "Using $test_ip, which is onnode $test_node" +# This test depends on being able to assign a duplicate address on a +# 2nd node. However, IPv6 guards against this and causes the test to +# fail. +case "$test_ip" in +*:*) + echo "SKIPPING TEST: not supported for IPv6 addresses" + exit 0 + ;; +esac + get_test_ip_mask_and_iface echo "Finding another node that knows about $test_ip" diff --git a/ctdb/tests/complex/61_rogueip_takeip.sh b/ctdb/tests/complex/61_rogueip_takeip.sh index 2c5f7c5c999..e1981eba572 100755 --- a/ctdb/tests/complex/61_rogueip_takeip.sh +++ b/ctdb/tests/complex/61_rogueip_takeip.sh @@ -21,6 +21,20 @@ select_test_node_and_ips echo "Running test against node $test_node and IP $test_ip" +# This test puts an address on an interface and then needs to quickly +# configure that address and cause an IP takeover. However, an IPv6 +# address will be tentative for a while so "quickly" is not possible". +# When ctdb_control_takeover_ip() calls ctdb_sys_have_ip() it will +# decide that the address is not present. It then attempts a takeip, +# which can fail if the address is suddenly present because it is no +# longer tentative. +case "$test_ip" in +*:*) + echo "SKIPPING TEST: not supported for IPv6 addresses" + exit 0 + ;; +esac + get_test_ip_mask_and_iface echo "Deleting IP $test_ip from all nodes" -- 2.24.1