Take in account the case of `ip neigh add` failure

master
Alarig Le Lay 4 years ago
parent 67de411db8
commit 2216508846

@ -176,6 +176,12 @@ for ID_RANGE_V4 in ${ID_RANGES_V4}; do
echo "${COMMAND}"
write_log INFO "${COMMAND}"
${COMMAND}
# If the previous command fails, its because trafic has
# already be sent to the VM
if [ $? =2 ]; then
ip neigh replace ${VM_IPV4} lladdr ${MAC} dev tap${VM_ID}i0
fi
else
# En cas d'echec, on continue de parcourir les autres RANGES
write_log WARN 'Empty value or doent correspond to an IPv4'
@ -213,6 +219,12 @@ for ID_RANGE_V6 in ${ID_RANGES_V6}; do
echo "${COMMAND}"
write_log INFO "${COMMAND}"
${COMMAND}
# If the previous command fails, its because trafic has
# already be sent to the VM
if [ $? =2 ]; then
ip neigh replace ${VM_NH} lladdr ${MAC} dev tap${VM_ID}i0
fi
else
# En cas d'echec, on continue de parcourir les autres RANGES
echo "Valeur vide ou ne correspond pas à un range IPV6"

Loading…
Cancel
Save