From ba47153754cf4ead288a2cc6e56d901424804ec9 Mon Sep 17 00:00:00 2001 From: Mikhail Feoktistov Date: Tue, 18 Jun 2019 09:45:13 -0400 Subject: [PATCH] Fix ifup-ib Check status code after arping only. Otherwise we always get an error "address already in use" if ARPCHECK="no" --- rdma.ifup-ib | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rdma.ifup-ib b/rdma.ifup-ib index 9efea51..7200e60 100644 --- a/rdma.ifup-ib +++ b/rdma.ifup-ib @@ -233,11 +233,12 @@ else fi if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then - [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \ - /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} - if [ $? = 1 ]; then - net_log $"Error, some other host already uses address ${ipaddr[$idx]}." - exit 1 + if [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ]; then + /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} + if [ $? = 1 ]; then + net_log $"Error, some other host already uses address ${ipaddr[$idx]}." + exit 1 + fi fi if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \