Skip to content
Browse files

The deletion of the primary IP via the ip command will also remove th…

…e secondary IP. Thus, trying to delete the secondary IP after the primary IP was deleted will result in an error. This fix assures that delete_interface() will only result in an error if ' addr delete' has failed and the ip is still listed in addr show.
  • Loading branch information...
1 parent d8135c3 commit 2c6d3bc392a698f2d09900d39a4901ba74f17e1f Martin Walter committed Jul 15, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 heartbeat/IPaddr2
View
10 heartbeat/IPaddr2
@@ -417,8 +417,16 @@ delete_interface () {
netmask="$3"
CMD="$IP2UTIL -f inet addr delete $ipaddr/$netmask dev $iface"
+ ocf_run $CMD
- ocf_run $CMD || return $OCF_ERR_GENERIC
+ if [ $? -ne 0 ]; then
+ CMD="$IP2UTIL -f inet addr show dev $iface | grep '$ipaddr\/$netmask'"
+ ocf_run $CMD
+
+ if [ $? -eq 0 ]; then
+ return $OCF_ERR_GENERIC
+ fi
+ fi
if ocf_is_true $OCF_RESKEY_flush_routes; then
ocf_run $IP2UTIL route flush cache

0 comments on commit 2c6d3bc

Please sign in to comment.
Something went wrong with that request. Please try again.