|
|
79554c |
From 2918ab999cbcbe6bc04061dd070e5b0dd8465346 Mon Sep 17 00:00:00 2001
|
|
|
79554c |
From: Damien Ciabrini <dciabrin@redhat.com>
|
|
|
79554c |
Date: Wed, 26 Apr 2017 17:51:52 +0200
|
|
|
79554c |
Subject: [PATCH] IPaddr2: add option for specifying IPv6's preferred_lft
|
|
|
79554c |
|
|
|
79554c |
This change allows setting the preferred_lft option when creating an
|
|
|
79554c |
IPv6 address. This can be used to ensure that the created IP address
|
|
|
79554c |
will not be used as a source address for routing.
|
|
|
79554c |
---
|
|
|
79554c |
heartbeat/IPaddr2 | 23 +++++++++++++++++++++++
|
|
|
79554c |
1 file changed, 23 insertions(+)
|
|
|
79554c |
|
|
|
79554c |
diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
|
|
|
79554c |
index 27b7208..2d2ba2c 100755
|
|
|
79554c |
--- a/heartbeat/IPaddr2
|
|
|
79554c |
+++ b/heartbeat/IPaddr2
|
|
|
79554c |
@@ -56,6 +56,7 @@
|
|
|
79554c |
# OCF_RESKEY_arp_count
|
|
|
79554c |
# OCF_RESKEY_arp_bg
|
|
|
79554c |
# OCF_RESKEY_arp_mac
|
|
|
79554c |
+# OCF_RESKEY_preferred_lft
|
|
|
79554c |
#
|
|
|
79554c |
# OCF_RESKEY_CRM_meta_clone
|
|
|
79554c |
# OCF_RESKEY_CRM_meta_clone_max
|
|
|
79554c |
@@ -80,6 +81,7 @@ OCF_RESKEY_arp_count_refresh_default=0
|
|
|
79554c |
OCF_RESKEY_arp_bg_default=true
|
|
|
79554c |
OCF_RESKEY_arp_mac_default="ffffffffffff"
|
|
|
15862b |
OCF_RESKEY_run_arping_default=false
|
|
|
79554c |
+OCF_RESKEY_preferred_lft_default="forever"
|
|
|
79554c |
|
|
|
79554c |
: ${OCF_RESKEY_lvs_support=${OCF_RESKEY_lvs_support_default}}
|
|
|
79554c |
: ${OCF_RESKEY_lvs_ipv6_addrlabel=${OCF_RESKEY_lvs_ipv6_addrlabel_default}}
|
|
|
15862b |
@@ -92,6 +94,7 @@ OCF_RESKEY_run_arping_default=false
|
|
|
79554c |
: ${OCF_RESKEY_arp_bg=${OCF_RESKEY_arp_bg_default}}
|
|
|
79554c |
: ${OCF_RESKEY_arp_mac=${OCF_RESKEY_arp_mac_default}}
|
|
|
15862b |
: ${OCF_RESKEY_run_arping=${OCF_RESKEY_run_arping_default}}
|
|
|
79554c |
+: ${OCF_RESKEY_preferred_lft=${OCF_RESKEY_preferred_lft_default}}
|
|
|
79554c |
#######################################################################
|
|
|
79554c |
|
|
|
79554c |
SENDARP=$HA_BIN/send_arp
|
|
|
79554c |
@@ -350,6 +353,17 @@ Whether or not to run arping for IPv4 collision detection check.
|
|
|
79554c |
<content type="string" default="${OCF_RESKEY_run_arping_default}"/>
|
|
|
79554c |
</parameter>
|
|
|
79554c |
|
|
|
79554c |
+<parameter name="preferred_lft">
|
|
|
79554c |
+<longdesc lang="en">
|
|
|
79554c |
+For IPv6, set the preferred lifetime of the IP address.
|
|
|
79554c |
+This can be used to ensure that the created IP address will not
|
|
|
79554c |
+be used as a source address for routing.
|
|
|
79554c |
+Expects a value as specified in section 5.5.4 of RFC 4862.
|
|
|
79554c |
+</longdesc>
|
|
|
79554c |
+<shortdesc lang="en">IPv6 preferred lifetime</shortdesc>
|
|
|
79554c |
+<content type="string" default="${OCF_RESKEY_preferred_lft_default}"/>
|
|
|
79554c |
+</parameter>
|
|
|
79554c |
+
|
|
|
79554c |
</parameters>
|
|
|
79554c |
<actions>
|
|
|
79554c |
<action name="start" timeout="20s" />
|
|
|
79554c |
@@ -590,6 +604,10 @@ add_interface () {
|
|
|
79554c |
cmd="$cmd label $label"
|
|
|
79554c |
msg="${msg} (with label $label)"
|
|
|
79554c |
fi
|
|
|
79554c |
+ if [ "$FAMILY" = "inet6" ] ;then
|
|
|
79554c |
+ cmd="$cmd preferred_lft $OCF_RESKEY_preferred_lft"
|
|
|
79554c |
+ msg="${msg} (with preferred_lft $OCF_RESKEY_preferred_lft)"
|
|
|
79554c |
+ fi
|
|
|
79554c |
|
|
|
79554c |
ocf_log info "$msg"
|
|
|
79554c |
ocf_run $cmd || return $OCF_ERR_GENERIC
|
|
|
79554c |
@@ -1076,6 +1094,11 @@ ip_validate() {
|
|
|
79554c |
exit $OCF_ERR_CONFIGURED
|
|
|
79554c |
fi
|
|
|
79554c |
|
|
|
79554c |
+ if [ -z "$OCF_RESKEY_preferred_lft" ]; then
|
|
|
79554c |
+ ocf_exit_reason "Empty value is invalid for OCF_RESKEY_preferred_lft"
|
|
|
79554c |
+ exit $OCF_ERR_CONFIGURED
|
|
|
79554c |
+ fi
|
|
|
79554c |
+
|
|
|
79554c |
if [ -n "$IP_CIP" ]; then
|
|
|
79554c |
|
|
|
79554c |
local valid=1
|