From a26414d9827004c10f30d79da1a500a79c147055 Mon Sep 17 00:00:00 2001 From: Bart Wensley Date: Thu, 22 Nov 2018 15:45:18 -0600 Subject: [PATCH] IPaddr2 resource agent fix for loopback interface The IPaddr2 resource agent currently assigns addresses to the loopback interface without specifying the scope, so they default to the global scope. This fails if the address is not in the loopback address range. The fix is to always specify "scope host" when assigning addresses to the loopback interface. Change-Id: Ib7c08bfc1c661a9fb347308e55cc806b4dd129ad Story: 2003910 Task: 26796 Signed-off-by: Bart Wensley --- .../centos/meta_patches/PATCH_ORDER | 1 + ...-host-scope-for-addresses-on-loopbac.patch | 32 ++++++++++++++++ ...host-scope-for-addresses-on-loopback.patch | 37 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 base/cluster-resource-agents/centos/meta_patches/spec-ipaddr2-use-host-scope-for-addresses-on-loopbac.patch create mode 100644 base/cluster-resource-agents/centos/patches/ipaddr2-use-host-scope-for-addresses-on-loopback.patch diff --git a/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER b/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER index e4b0c166e..60b97427e 100644 --- a/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER +++ b/base/cluster-resource-agents/centos/meta_patches/PATCH_ORDER @@ -11,3 +11,4 @@ spec-add-ipaddr2-ignore-lo-state.patch Disable-creation-of-the-debug-package.patch metapatch-for-arp_bg.patch ipaddr2-avoid-failing-svc-if-down-meta.patch +spec-ipaddr2-use-host-scope-for-addresses-on-loopbac.patch diff --git a/base/cluster-resource-agents/centos/meta_patches/spec-ipaddr2-use-host-scope-for-addresses-on-loopbac.patch b/base/cluster-resource-agents/centos/meta_patches/spec-ipaddr2-use-host-scope-for-addresses-on-loopbac.patch new file mode 100644 index 000000000..21762c731 --- /dev/null +++ b/base/cluster-resource-agents/centos/meta_patches/spec-ipaddr2-use-host-scope-for-addresses-on-loopbac.patch @@ -0,0 +1,32 @@ +From d5796dce7ea3bc1a90a3faed3b7acff36583c5e0 Mon Sep 17 00:00:00 2001 +From: Bart Wensley +Date: Wed, 21 Nov 2018 12:21:41 -0600 +Subject: [PATCH 1/1] spec ipaddr2 use host scope for addresses on loopback + +--- + SPECS/resource-agents.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec +index 959f4db..a98064a 100644 +--- a/SPECS/resource-agents.spec ++++ b/SPECS/resource-agents.spec +@@ -284,6 +284,7 @@ Patch1118: ipaddr2_if_down.patch + Patch1119: ipaddr2_ignore_lo_if_state.patch + Patch1120: Re-enable-background-execution-of-arp-commands.patch + Patch1121: ipaddr2-avoid-failing-svc-if-down.patch ++Patch1122: ipaddr2-use-host-scope-for-addresses-on-loopback.patch + + Obsoletes: heartbeat-resources <= %{version} + Provides: heartbeat-resources = %{version} +@@ -622,6 +623,7 @@ exit 1 + %patch1119 -p1 + %patch1120 -p1 + %patch1121 -p1 ++%patch1122 -p1 + + %build + if [ ! -f configure ]; then +-- +1.8.3.1 + diff --git a/base/cluster-resource-agents/centos/patches/ipaddr2-use-host-scope-for-addresses-on-loopback.patch b/base/cluster-resource-agents/centos/patches/ipaddr2-use-host-scope-for-addresses-on-loopback.patch new file mode 100644 index 000000000..03b03ee46 --- /dev/null +++ b/base/cluster-resource-agents/centos/patches/ipaddr2-use-host-scope-for-addresses-on-loopback.patch @@ -0,0 +1,37 @@ +From a39c83dbaf4054cc96cd4a0a2b671509dd10af28 Mon Sep 17 00:00:00 2001 +From: Bart Wensley +Date: Wed, 21 Nov 2018 12:14:20 -0600 +Subject: [PATCH 1/1] ipaddr2 use host scope for addresses on loopback + +--- + heartbeat/IPaddr2 | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2 +index 2da5c5e..79dbdcf 100755 +--- a/heartbeat/IPaddr2 ++++ b/heartbeat/IPaddr2 +@@ -584,10 +584,18 @@ add_interface () { + add_ipv6_addrlabel $ipaddr + fi + +- cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask dev $iface" ++ # Addresses assigned to the loopback interfaces must be assigned ++ # using the host scope or assignment is prevented (can't have ++ # multiple global scope addresses on the loopback interface). ++ if [ "$iface" = "lo" ] ;then ++ option="scope host" ++ else ++ option="" ++ fi ++ cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask dev $iface $option" + msg="Adding $FAMILY address $ipaddr/$netmask to device $iface" + if [ "$broadcast" != "none" ]; then +- cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask brd $broadcast dev $iface" ++ cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask brd $broadcast dev $iface $option" + msg="Adding $FAMILY address $ipaddr/$netmask with broadcast address $broadcast to device $iface" + fi + +-- +1.8.3.1 +