diff -Nru resource-agents-4.2.0/debian/changelog resource-agents-4.2.0/debian/changelog --- resource-agents-4.2.0/debian/changelog 2018-11-22 12:31:51.000000000 -0200 +++ resource-agents-4.2.0/debian/changelog 2019-04-23 14:17:29.000000000 -0300 @@ -1,3 +1,14 @@ +resource-agents (1:4.2.0-1ubuntu2) unstable; urgency=medium + + * Fix heartbeat/ethmonitor not listing network interfaces without IP + addresses (LP: #1825250). Fixed by upstream patches: + - d/p/lp1825250-ethmonitor-check-if-interface-exists-by-link.patch: + ethmonitor: check if interface exists by link + - d/p/lp1825250-ethmonitor-fix-is_interface-regression.patch: + ethmonitor: fix is_interface() regression + + -- Heitor Alves de Siqueira Tue, 23 Apr 2019 14:17:29 -0300 + resource-agents (1:4.2.0-1ubuntu1) disco; urgency=medium * d/control: Demote python3-googleapi to Suggests to avoid inclusion diff -Nru resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-check-if-interface-exists-by-link.patch resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-check-if-interface-exists-by-link.patch --- resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-check-if-interface-exists-by-link.patch 1969-12-31 21:00:00.000000000 -0300 +++ resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-check-if-interface-exists-by-link.patch 2019-04-23 14:17:23.000000000 -0300 @@ -0,0 +1,62 @@ +From 40d05029ce0b2ad437377cf9a8bcb4c91508fa89 Mon Sep 17 00:00:00 2001 +From: "Heitor R. Alves de Siqueira" +Date: Thu, 21 Mar 2019 16:29:33 -0300 +Subject: [PATCH] ethmonitor: check if interface exists by link + +This patch changes the '-f inet' parameter to '-f link' so that all +interfaces are listed correctly in the is_interface() function. Since +this changes output from 'ip' slightly, we also remove a trailing +semicolon from the interface name. + +The is_interface() function in ethmonitor tries to match an interface +to a list obtained from the 'ip' tool. It lists interfaces using the +'inet' family, which omits interfaces that don't have an IP address +assigned: + +$ ip -a -o -f inet addr show | cut -d ' ' -f2 | sort -u \ + | grep -v '^ipsec[0-9][0-9]*$' +lo +lxdbr0 +tun0 +virbr0 +wlp3s0 + +If the interface that we're looking for is e.g. a VLAN bridge that does +not have an IP address, it won't show up in the listing and +is_interface() will return false. If we list available interfaces by +link instead, we also get the ones that don't currently have an +address: + +$ ip -a -o -f link addr show | cut -d ' ' -f2 | sort -u \ + | grep -v '^ipsec[0-9][0-9]*$' | tr -d ':' +enp0s31f6 +lo +lxdbr0 +tun0 +vethSW7OU3@if37 +virbr0 +virbr0-nic +vnet0 +wlp3s0 + +Origin: upstream, https://github.com/ClusterLabs/resource-agents/commit/40d05029ce0b +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1825250 +--- + heartbeat/ethmonitor | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: resource-agents-4.2.0/heartbeat/ethmonitor +=================================================================== +--- resource-agents-4.2.0.orig/heartbeat/ethmonitor ++++ resource-agents-4.2.0/heartbeat/ethmonitor +@@ -206,8 +206,8 @@ is_interface() { + # + # List interfaces but exclude FreeS/WAN ipsecN virtual interfaces + # +- local iface=`$IP2UTIL -o -f inet addr show | grep " $1 " \ +- | cut -d ' ' -f2 | sort -u | grep -v '^ipsec[0-9][0-9]*$'` ++ local iface=`$IP2UTIL -o -f link addr show | grep " $1 " \ ++ | cut -d ' ' -f2 | tr -d ':' | sort -u | grep -v '^ipsec[0-9][0-9]*$'` + [ "$iface" != "" ] + } + diff -Nru resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-fix-is_interface-regression.patch resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-fix-is_interface-regression.patch --- resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-fix-is_interface-regression.patch 1969-12-31 21:00:00.000000000 -0300 +++ resource-agents-4.2.0/debian/patches/lp1825250-ethmonitor-fix-is_interface-regression.patch 2019-04-23 14:17:27.000000000 -0300 @@ -0,0 +1,28 @@ +From c0ac191c73f1a3cf62d54b7ec59992997cca3810 Mon Sep 17 00:00:00 2001 +From: Heitor Alves de Siqueira +Date: Wed, 17 Apr 2019 17:16:39 -0300 +Subject: [PATCH] ethmonitor: fix is_interface() regression + +Commit 40d05029ce0b changed is_interface() to list by link instead of +address. We need to adjust the grep filter for the new output format, +else we'll miss interfaces. + +Origin: upstream, https://github.com/ClusterLabs/resource-agents/commit/c0ac191c73f1 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1825250 +--- + heartbeat/ethmonitor | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: resource-agents-4.2.0/heartbeat/ethmonitor +=================================================================== +--- resource-agents-4.2.0.orig/heartbeat/ethmonitor ++++ resource-agents-4.2.0/heartbeat/ethmonitor +@@ -206,7 +206,7 @@ is_interface() { + # + # List interfaces but exclude FreeS/WAN ipsecN virtual interfaces + # +- local iface=`$IP2UTIL -o -f link addr show | grep " $1 " \ ++ local iface=`$IP2UTIL -o -f link addr show | grep " $1:" \ + | cut -d ' ' -f2 | tr -d ':' | sort -u | grep -v '^ipsec[0-9][0-9]*$'` + [ "$iface" != "" ] + } diff -Nru resource-agents-4.2.0/debian/patches/series resource-agents-4.2.0/debian/patches/series --- resource-agents-4.2.0/debian/patches/series 2018-10-24 06:43:05.000000000 -0300 +++ resource-agents-4.2.0/debian/patches/series 2019-04-23 14:17:25.000000000 -0300 @@ -6,3 +6,5 @@ xen-toolstack.patch gitignore.patch reproducible.patch +lp1825250-ethmonitor-check-if-interface-exists-by-link.patch +lp1825250-ethmonitor-fix-is_interface-regression.patch