Discussion:
[Linux-ha-dev] [PATCH] Patch to make Route RA IPv6 ready
Robert Sander
2013-05-24 20:44:39 UTC
Permalink
Signed-off-by: Robert Sander <***@heinlein-support.de>
---
heartbeat/Route | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/heartbeat/Route b/heartbeat/Route
index 7e28f03..3b775f1 100755
--- a/heartbeat/Route
+++ b/heartbeat/Route
@@ -201,7 +201,7 @@ route_stop() {
}

route_status() {
- show_output="$(ip route show $(create_route_spec) 2>/dev/null)"
+ show_output="$(ip $addr_family route show $(create_route_spec) 2>/dev/null)"
if [ $? -eq 0 ]; then
if [ -n "$show_output" ]; then
# "ip route show" returned zero, and produced output on
@@ -290,6 +290,12 @@ for binary in ip grep; do
done

route_validate || exit $?
+
+addr_family="-4"
+if echo ${OCF_RESKEY_destination} | grep -q ":" ; then
+ addr_family="-6"
+fi
+
case $__OCF_ACTION in
start) route_start;;
stop) route_stop;;
--
1.7.10.4
Robert Sander
2013-05-25 22:17:12 UTC
Permalink
This little patch makes the Route RA IPv6 ready.

The only missing bit was the status report where "ip route show" will only output IPv4 routes.
This makes the original RA think that the IPv6 route is always down.


Signed-off-by: Robert Sander <***@heinlein-support.de>
---
heartbeat/Route | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/heartbeat/Route b/heartbeat/Route
index 7e28f03..3b775f1 100755
--- a/heartbeat/Route
+++ b/heartbeat/Route
@@ -201,7 +201,7 @@ route_stop() {
}

route_status() {
- show_output="$(ip route show $(create_route_spec) 2>/dev/null)"
+ show_output="$(ip $addr_family route show $(create_route_spec) 2>/dev/null)"
if [ $? -eq 0 ]; then
if [ -n "$show_output" ]; then
# "ip route show" returned zero, and produced output on
@@ -290,6 +290,12 @@ for binary in ip grep; do
done

route_validate || exit $?
+
+addr_family="-4"
+if echo ${OCF_RESKEY_destination} | grep -q ":" ; then
+ addr_family="-6"
+fi
+
case $__OCF_ACTION in
start) route_start;;
stop) route_stop;;
--
1.7.10.4
Robert Sander
2013-05-30 07:36:34 UTC
Permalink
This little patch makes the Route RA IPv6 ready.

The only missing bit was the status report where "ip route show" will
only output IPv4 routes.
This makes the original RA think that the IPv6 route is always down.


Signed-off-by: Robert Sander <***@heinlein-support.de>
---
heartbeat/Route | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/heartbeat/Route b/heartbeat/Route
index 7e28f03..3b775f1 100755
--- a/heartbeat/Route
+++ b/heartbeat/Route
@@ -201,7 +201,7 @@ route_stop() {
}

route_status() {
- show_output="$(ip route show $(create_route_spec) 2>/dev/null)"
+ show_output="$(ip $addr_family route show $(create_route_spec)
2>/dev/null)"
if [ $? -eq 0 ]; then
if [ -n "$show_output" ]; then
# "ip route show" returned zero, and produced output on
@@ -290,6 +290,12 @@ for binary in ip grep; do
done

route_validate || exit $?
+
+addr_family="-4"
+if echo ${OCF_RESKEY_destination} | grep -q ":" ; then
+ addr_family="-6"
+fi
+
case $__OCF_ACTION in
start) route_start;;
stop) route_stop;;
-- 1.7.10.4
--
Robert Sander
Heinlein Support GmbH
Schwedter Str. 8/9b, 10119 Berlin

http://www.heinlein-support.de

Tel: 030 / 405051-43
Fax: 030 / 405051-19

Zwangsangaben lt. §35a GmbHG:
HRB 93818 B / Amtsgericht Berlin-Charlottenburg,
Geschäftsführer: Peer Heinlein -- Sitz: Berlin
Lars Ellenberg
2013-06-03 21:01:23 UTC
Permalink
Post by Robert Sander
This little patch makes the Route RA IPv6 ready.
Sorry for the huge delay.
Will make sure this is merged right away.

Thanks,
Lars
--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
Loading...