Blame SOURCES/bz1741042-IPaddr2-add-noprefixroute-parameter.patch

9cf66a
From 34b46b172857babbb2bca5e012c7827ed6a26b01 Mon Sep 17 00:00:00 2001
9cf66a
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
9cf66a
Date: Wed, 6 Nov 2019 10:00:31 +0100
9cf66a
Subject: [PATCH] IPaddr2: add noprefixroute parameter
9cf66a
9cf66a
---
9cf66a
 heartbeat/IPaddr2 | 17 ++++++++++++++++-
9cf66a
 1 file changed, 16 insertions(+), 1 deletion(-)
9cf66a
9cf66a
diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
9cf66a
index 1d39ae514..6f8e8c734 100755
9cf66a
--- a/heartbeat/IPaddr2
9cf66a
+++ b/heartbeat/IPaddr2
9cf66a
@@ -88,6 +88,7 @@ OCF_RESKEY_arp_sender_default=""
9cf66a
 OCF_RESKEY_send_arp_opts_default=""
9cf66a
 OCF_RESKEY_flush_routes_default="false"
9cf66a
 OCF_RESKEY_run_arping_default=false
9cf66a
+OCF_RESKEY_noprefixroute_default="false"
9cf66a
 OCF_RESKEY_preferred_lft_default="forever"
9cf66a
 OCF_RESKEY_network_namespace_default=""
9cf66a
 
9cf66a
@@ -109,6 +110,7 @@ OCF_RESKEY_network_namespace_default=""
9cf66a
 : ${OCF_RESKEY_send_arp_opts=${OCF_RESKEY_send_arp_opts_default}}
9cf66a
 : ${OCF_RESKEY_flush_routes=${OCF_RESKEY_flush_routes_default}}
9cf66a
 : ${OCF_RESKEY_run_arping=${OCF_RESKEY_run_arping_default}}
9cf66a
+: ${OCF_RESKEY_noprefixroute=${OCF_RESKEY_noprefixroute_default}}
9cf66a
 : ${OCF_RESKEY_preferred_lft=${OCF_RESKEY_preferred_lft_default}}
9cf66a
 : ${OCF_RESKEY_network_namespace=${OCF_RESKEY_network_namespace_default}}
9cf66a
 
9cf66a
@@ -377,6 +379,14 @@ Whether or not to run arping for IPv4 collision detection check.
9cf66a
 <content type="string" default="${OCF_RESKEY_run_arping_default}"/>
9cf66a
 </parameter>
9cf66a
 
9cf66a
+<parameter name="noprefixroute">
9cf66a
+<longdesc lang="en">
9cf66a
+Use noprefixroute flag (see 'man ip-address').
9cf66a
+</longdesc>
9cf66a
+<shortdesc lang="en">Use noprefixroute flag</shortdesc>
9cf66a
+<content type="string" default="${OCF_RESKEY_noprefixroute_default}"/>
9cf66a
+</parameter>
9cf66a
+
9cf66a
 <parameter name="preferred_lft">
9cf66a
 <longdesc lang="en">
9cf66a
 For IPv6, set the preferred lifetime of the IP address.
9cf66a
@@ -397,8 +407,8 @@ the namespace.
9cf66a
 <shortdesc lang="en">Network namespace to use</shortdesc>
9cf66a
 <content type="string" default="${OCF_RESKEY_network_namespace_default}"/>
9cf66a
 </parameter>
9cf66a
-
9cf66a
 </parameters>
9cf66a
+
9cf66a
 <actions>
9cf66a
 <action name="start"   timeout="20s" />
9cf66a
 <action name="stop"    timeout="20s" />
9cf66a
@@ -640,6 +650,11 @@ add_interface () {
9cf66a
 		msg="Adding $FAMILY address $ipaddr/$netmask with broadcast address $broadcast to device $iface"
9cf66a
 	fi
9cf66a
 
9cf66a
+	if ocf_is_true "${OCF_RESKEY_noprefixroute}"; then
9cf66a
+		cmd="$cmd noprefixroute"
9cf66a
+		msg="${msg} (with noprefixroute)"
9cf66a
+	fi
9cf66a
+
9cf66a
 	if [ ! -z "$label" ]; then
9cf66a
 		cmd="$cmd label $label"
9cf66a
 		msg="${msg} (with label $label)"