|
|
734564 |
From 0e73d3f474d08779b64ed99fb3f80c1e806ff1b7 Mon Sep 17 00:00:00 2001
|
|
|
734564 |
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
|
|
734564 |
Date: Thu, 28 Nov 2019 16:11:51 +0100
|
|
|
734564 |
Subject: [PATCH] IPsrcaddr: fixes to replace local rule if using local table,
|
|
|
734564 |
and set src back to primary for device on stop
|
|
|
734564 |
|
|
|
734564 |
---
|
|
|
734564 |
heartbeat/IPsrcaddr | 14 ++++++++++++--
|
|
|
734564 |
1 file changed, 12 insertions(+), 2 deletions(-)
|
|
|
734564 |
|
|
|
734564 |
diff --git a/heartbeat/IPsrcaddr b/heartbeat/IPsrcaddr
|
|
|
734564 |
index d80b72165..f9085f082 100755
|
|
|
734564 |
--- a/heartbeat/IPsrcaddr
|
|
|
734564 |
+++ b/heartbeat/IPsrcaddr
|
|
|
734564 |
@@ -75,6 +75,10 @@ USAGE="usage: $0 {start|stop|status|monitor|validate-all|meta-data}";
|
|
|
734564 |
CMDSHOW="$IP2UTIL route show $TABLE to exact $OCF_RESKEY_destination"
|
|
|
734564 |
CMDCHANGE="$IP2UTIL route change to "
|
|
|
734564 |
|
|
|
734564 |
+if [ "$OCF_RESKEY_table" = "local" ]; then
|
|
|
734564 |
+ TABLE="$TABLE local"
|
|
|
734564 |
+fi
|
|
|
734564 |
+
|
|
|
734564 |
SYSTYPE="`uname -s`"
|
|
|
734564 |
|
|
|
734564 |
usage() {
|
|
|
734564 |
@@ -247,8 +251,14 @@ srca_stop() {
|
|
|
734564 |
|
|
|
734564 |
[ $rc = 2 ] && errorexit "The address you specified to stop does not match the preferred source address"
|
|
|
734564 |
|
|
|
734564 |
- $IP2UTIL route replace $TABLE $NETWORK dev $INTERFACE || \
|
|
|
734564 |
- errorexit "command 'ip route replace $TABLE $NETWORK dev $INTERFACE' failed"
|
|
|
734564 |
+ OPTS=""
|
|
|
734564 |
+ if [ "$OCF_RESKEY_destination" != "0.0.0.0/0" ] ;then
|
|
|
734564 |
+ PRIMARY_IP="$($IP2UTIL -4 -o addr show dev eth0 primary | awk '{split($4,a,"/");print a[1]}')"
|
|
|
734564 |
+ OPTS="proto kernel scope host src $PRIMARY_IP"
|
|
|
734564 |
+ fi
|
|
|
734564 |
+
|
|
|
734564 |
+ $IP2UTIL route replace $TABLE $NETWORK dev $INTERFACE $OPTS || \
|
|
|
734564 |
+ errorexit "command 'ip route replace $TABLE $NETWORK dev $INTERFACE $OPTS' failed"
|
|
|
734564 |
|
|
|
734564 |
if [ "$OCF_RESKEY_destination" = "0.0.0.0/0" ] ;then
|
|
|
734564 |
$CMDCHANGE $ROUTE_WO_SRC || \
|