#!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
+# Double quotes to prevent globbing and word splitting is recommended in new
+# code but we accept it, especially because there were too many before having
+# address all other issues detected by shellcheck.
+#shellcheck disable=SC2086
+
 . "$(dirname "${0}")/mptcp_lib.sh"
 
 ns=""
-ksft_skip=4
 test_cnt=1
 timeout_poll=30
 timeout_test=$((timeout_poll * 2 + 1))
        done
 }
 
+# This function is used in the cleanup trap
+#shellcheck disable=SC2317
 cleanup()
 {
        ip netns pids "${ns}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null
        expected=$((expected + listen_nr))
 
        for _ in $(seq 10); do
-               if [ $(get_msk_inuse) -eq $expected ];then
+               if [ "$(get_msk_inuse)" -eq $expected ]; then
                        break
                fi
                sleep 0.1
 chk_msk_cestab 0 "1->0"
 
 NR_CLIENTS=100
-for I in `seq 1 $NR_CLIENTS`; do
+for I in $(seq 1 $NR_CLIENTS); do
        echo "a" | \
                timeout ${timeout_test} \
                        ip netns exec $ns \
 done
 mptcp_lib_wait_local_port_listen $ns $((NR_CLIENTS + 10001))
 
-for I in `seq 1 $NR_CLIENTS`; do
+for I in $(seq 1 $NR_CLIENTS); do
        echo "b" | \
                timeout ${timeout_test} \
                        ip netns exec $ns \