From d01948583635a2fcfb0e5060e6fba75a66eaca8a Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 Sep 2023 10:10:01 +0200 Subject: [PATCH] Remove if* interface in MPTCP --- mptcp/files/usr/bin/multipath | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mptcp/files/usr/bin/multipath b/mptcp/files/usr/bin/multipath index 3609eaf51..d0f1b4962 100755 --- a/mptcp/files/usr/bin/multipath +++ b/mptcp/files/usr/bin/multipath @@ -131,6 +131,14 @@ if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH else + # Remove not needed if* interfaces in MPTCP + oldintfs=$(ip mptcp endpoint show | grep "dev eth" | awk '{ print $3 }') + [ -n "$oldintfs" ] && { + for oldintf in $oldintfs; do + ip mptcp endpoint delete id $oldintf 2>&1 >/dev/null + 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}') IP=$(ip a show $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')