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 <[email protected]>
---
 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
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to