diff --git a/mptcp/files/usr/bin/multipath b/mptcp/files/usr/bin/multipath index a44d7f24b9..3e75eb5e79 100755 --- a/mptcp/files/usr/bin/multipath +++ b/mptcp/files/usr/bin/multipath @@ -139,12 +139,12 @@ else done } - ID=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $3}') - IFF=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $4}') + ID=$(ip mptcp endpoint show | sort | grep -m 1 -E "dev $DEVICE " | awk '{print $3}') + IFF=$(ip mptcp endpoint show | sort | grep -m 1 -E "dev $DEVICE " | awk '{print $4}') #IP=$(ip a show $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') [ -f /usr/bin/jsonfilter ] && IP=$(ip -j a show $DEVICE | jsonfilter -e '@[0].addr_info[*].local') [ -f /usr/bin/jq ] && IP=$(ip -j a show $DEVICE | jq -r '.[0].addr_info[].local') - [ -z "$ID" ] && [ -n "$IP" ] && ID=$(ip mptcp endpoint show | grep "$IP" | awk '{print $3}') + [ -z "$ID" ] && [ -n "$IP" ] && ID=$(ip mptcp endpoint show | grep "$IP " | awk '{print $3}') RMID=$(ip mptcp endpoint show | grep '::ffff' | awk '{ print $3 }') [ -n "$RMID" ] && ip mptcp endpoint delete id $RMID 2>&1 >/dev/null case $TYPE in