Skip to content

Avoid failure ip route replace $NETWORK #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions heartbeat/IPsrcaddr
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ srca_start() {
rc=$OCF_SUCCESS
ocf_log info "The ip route has been already set.($NETWORK, $INTERFACE, $ROUTE_WO_SRC)"
else
ip route replace $NETWORK dev $INTERFACE src $1 || \
errorexit "command 'ip route replace $NETWORK dev $INTERFACE src $1' failed"

$CMDCHANGE $ROUTE_WO_SRC src $1 || \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my cluster, changing the source ip address on default gateway (or via) should be before changing the source ip of the network.

errorexit "command '$CMDCHANGE $ROUTE_WO_SRC src $1' failed"

ip route replace $NETWORK dev $INTERFACE src $1 || \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If change the source ip of the network before changing the default via, the commands exit with error.

errorexit "command 'ip route replace $NETWORK dev $INTERFACE src $1' failed"
rc=$?
fi

Expand Down