Send gratutious ARPs on ip monitor event also

This commit sends gratuitious ARP requests in case
ip_monitor returns zero exit code. This will allow
for periodical updates of neighbours in case our IP
is OK and neighbour did not receive arps of the node
after ip was initially started.

Change-Id: I6d6134eee08352c1b0f0ef85dc79bfd6ee804378
Closes-bug: #1492210
This commit is contained in:
Vladimir Kuklin 2015-09-09 14:58:05 +03:00
parent 3a8ff78bd1
commit 8380734ab1
1 changed files with 10 additions and 1 deletions

View File

@ -485,7 +485,16 @@ ip_monitor() {
check_interfaces_for_up_state "$OCF_RESKEY_bridge:$OCF_RESKEY_also_check_interfaces" || return $OCF_NOT_RUNNING
# use arping here, because no IP from VIP network allowed on host system
ocf_run arping -c 32 -w 2 -I $OCF_RESKEY_bridge $OCF_RESKEY_ip || return $OCF_NOT_RUNNING
ocf_run arping -c 10 -w 2 -I $OCF_RESKEY_bridge $OCF_RESKEY_ip || return $OCF_NOT_RUNNING
# Send Gratuitous ARP REQUEST packets to update all neighbours in a detached background process
ARGS="-U -c 5 -w 2 -I $OCF_RESKEY_ns_veth -q $OCF_RESKEY_ip"
$RUN_IN_NS arping $ARGS 2>&1 > /dev/null &
# Send Gratuitous ARP REPLY packets to update all neighbours in a detached background process
ARGS="-A -c 5 -w 2 -I $OCF_RESKEY_ns_veth -q $OCF_RESKEY_ip"
$RUN_IN_NS arping $ARGS 2>&1 > /dev/null &
return $OCF_SUCCESS
}