ShellCheck - shell script analysis tool version: 0.10.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.NmC6PkcTOc and /tmp/tmp.KLEnFpZafw Tree base: dbf991022187 ("ovpn: use bound device in UDP when available") Now at: 9850ec0775b6 ("selftests: ovpn: add test for bound device") ====== Checking before the patch ====== Checking tools/testing/selftests/net/ovpn/common.sh - e3a67af2e113ee92dfb9cddd321874ac9c303e36744b0c6b1f1fc22173315989 In common.sh line 22: ip netns add peer${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns add peer"${1}" In common.sh line 28: if [ ${1} -eq 0 ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "${1}" -eq 0 ]; then In common.sh line 30: for p in $(seq 1 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 1 "${NUM_PEERS}"); do In common.sh line 31: ip link add veth${p} netns peer0 type veth peer name veth${p} netns peer${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add veth"${p}" netns peer0 type veth peer name veth"${p}" netns peer"${p}" In common.sh line 33: ip -n peer0 addr add 10.10.${p}.1/24 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 addr add 10.10."${p}".1/24 dev veth"${p}" In common.sh line 34: ip -n peer0 addr add fd00:0:0:${p}::1/64 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 addr add fd00:0:0:"${p}"::1/64 dev veth"${p}" In common.sh line 35: ip -n peer0 link set veth${p} up ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 link set veth"${p}" up In common.sh line 37: ip -n peer${p} addr add 10.10.${p}.2/24 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" addr add 10.10."${p}".2/24 dev veth"${p}" In common.sh line 38: ip -n peer${p} addr add fd00:0:0:${p}::2/64 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" addr add fd00:0:0:"${p}"::2/64 dev veth"${p}" In common.sh line 39: ip -n peer${p} link set veth${p} up ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" link set veth"${p}" up In common.sh line 43: ip netns exec peer${1} ${OVPN_CLI} new_iface tun${1} $MODE ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" new_iface tun"${1}" $MODE In common.sh line 44: ip -n peer${1} addr add ${2} dev tun${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" addr add "${2}" dev tun"${1}" In common.sh line 46: if [ ${1} -eq 1 -a -n "${LAN_IP}" ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. Did you mean: if [ "${1}" -eq 1 -a -n "${LAN_IP}" ]; then In common.sh line 47: ip -n peer${1} addr add ${LAN_IP} dev tun${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" addr add ${LAN_IP} dev tun"${1}" In common.sh line 48: ip -n peer0 route add ${LAN_IP} via $(echo ${2} |sed -e s'!/.*!!') dev tun0 ^----------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 route add ${LAN_IP} via $(echo "${2}" |sed -e s'!/.*!!') dev tun0 In common.sh line 51: ip -n peer${1} link set mtu ${3} dev tun${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" link set mtu "${3}" dev tun"${1}" In common.sh line 53: ip -n peer${1} link set tun${1} up ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" link set tun"${1}" up In common.sh line 62: PYTHONUNBUFFERED=1 ip netns exec peer${p} ${YNL_CLI} --family ovpn \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: PYTHONUNBUFFERED=1 ip netns exec peer"${p}" "${YNL_CLI}" --family ovpn \ In common.sh line 63: --subscribe peers --output-json --duration 40 > ${file} & ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: --subscribe peers --output-json --duration 40 > "${file}" & In common.sh line 70: if [ ${1} -eq 0 ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "${1}" -eq 0 ]; then In common.sh line 71: ip netns exec peer0 ${OVPN_CLI} new_multi_peer tun0 1 ${UDP_PEERS_FILE} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_multi_peer tun0 1 "${UDP_PEERS_FILE}" In common.sh line 73: for p in $(seq 1 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 1 "${NUM_PEERS}"); do In common.sh line 74: ip netns exec peer0 ${OVPN_CLI} new_key tun0 ${p} 1 0 ${ALG} 0 \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_key tun0 "${p}" 1 0 "${ALG}" 0 \ In common.sh line 78: TX_ID=$(awk "NR == ${1} {print \$2}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: TX_ID=$(awk "NR == ${1} {print \$2}" "${UDP_PEERS_FILE}") In common.sh line 79: RADDR=$(awk "NR == ${1} {print \$3}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: RADDR=$(awk "NR == ${1} {print \$3}" "${UDP_PEERS_FILE}") In common.sh line 80: RPORT=$(awk "NR == ${1} {print \$4}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: RPORT=$(awk "NR == ${1} {print \$4}" "${UDP_PEERS_FILE}") In common.sh line 81: LPORT=$(awk "NR == ${1} {print \$6}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: LPORT=$(awk "NR == ${1} {print \$6}" "${UDP_PEERS_FILE}") In common.sh line 82: ip netns exec peer${1} ${OVPN_CLI} new_peer tun${1} ${TX_ID} ${1} \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" new_peer tun"${1}" "${TX_ID}" "${1}" \ In common.sh line 83: ${LPORT} ${RADDR} ${RPORT} ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${LPORT}" "${RADDR}" "${RPORT}" In common.sh line 84: ip netns exec peer${1} ${OVPN_CLI} new_key tun${1} ${TX_ID} 1 0 \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" new_key tun"${1}" "${TX_ID}" 1 0 \ In common.sh line 85: ${ALG} 1 data64.key ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${ALG}" 1 data64.key In common.sh line 88: if [ ${1} -eq 0 ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "${1}" -eq 0 ]; then In common.sh line 89: (ip netns exec peer0 ${OVPN_CLI} listen tun0 1 ${TCP_PEERS_FILE} && { ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: (ip netns exec peer0 "${OVPN_CLI}" listen tun0 1 "${TCP_PEERS_FILE}" && { In common.sh line 90: for p in $(seq 1 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 1 "${NUM_PEERS}"); do In common.sh line 91: ip netns exec peer0 ${OVPN_CLI} new_key tun0 ${p} 1 0 \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_key tun0 "${p}" 1 0 \ In common.sh line 92: ${ALG} 0 data64.key ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${ALG}" 0 data64.key In common.sh line 97: TX_ID=$(awk "NR == ${1} {print \$2}" ${TCP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: TX_ID=$(awk "NR == ${1} {print \$2}" "${TCP_PEERS_FILE}") In common.sh line 98: ip netns exec peer${1} ${OVPN_CLI} connect tun${1} ${TX_ID} ${1} \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" connect tun"${1}" "${TX_ID}" "${1}" \ In common.sh line 99: 10.10.${1}.1 1 data64.key ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: 10.10."${1}".1 1 data64.key In common.sh line 110: kill -TERM ${listener_pids[$1]} || true ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill -TERM "${listener_pids[$1]}" || true In common.sh line 111: wait ${listener_pids[$1]} || true ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait "${listener_pids[$1]}" || true In common.sh line 112: printf "Checking notifications for peer ${1}... " ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In common.sh line 113: diff <(jq -s "${JQ_FILTER}" ${expexted}) \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: diff <(jq -s "${JQ_FILTER}" "${expexted}") \ In common.sh line 114: <(jq -s "${JQ_FILTER}" ${received}) ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: <(jq -s "${JQ_FILTER}" "${received}") In common.sh line 117: rm -f ${received} || true ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -f "${received}" || true In common.sh line 123: killall $(basename ${OVPN_CLI}) 2>/dev/null || true ^---------------------^ SC2046 (warning): Quote this to prevent word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: killall $(basename "${OVPN_CLI}") 2>/dev/null || true In common.sh line 127: ip -n peer${p} link set tun${p} down 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" link set tun"${p}" down 2>/dev/null || true In common.sh line 128: ip netns exec peer${p} ${OVPN_CLI} del_iface tun${p} 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${p}" "${OVPN_CLI}" del_iface tun"${p}" 2>/dev/null || true In common.sh line 131: ip -n peer0 link del veth${p} 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 link del veth"${p}" 2>/dev/null || true In common.sh line 134: ip netns del peer${p} 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns del peer"${p}" 2>/dev/null || true In common.sh line 139: NUM_PEERS=${NUM_PEERS:-$(wc -l ${UDP_PEERS_FILE} | awk '{print $1}')} ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NUM_PEERS=${NUM_PEERS:-$(wc -l "${UDP_PEERS_FILE}" | awk '{print $1}')} In common.sh line 141: NUM_PEERS=${NUM_PEERS:-$(wc -l ${TCP_PEERS_FILE} | awk '{print $1}')} ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NUM_PEERS=${NUM_PEERS:-$(wc -l "${TCP_PEERS_FILE}" | awk '{print $1}')} For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... Checking tools/testing/selftests/net/ovpn/test-mark.sh - 62413f616b2d8c2c30c9460fb0e3f9143841b79f6c88f785583b2a23156390a9 In test-mark.sh line 20: for p in $(seq 0 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 0 "${NUM_PEERS}"); do In test-mark.sh line 21: create_ns ${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: create_ns "${p}" In test-mark.sh line 25: setup_ns ${p} 5.5.5.$((${p} + 1))/24 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. Did you mean: setup_ns "${p}" 5.5.5.$((${p} + 1))/24 In test-mark.sh line 29: ip netns exec peer0 ${OVPN_CLI} new_multi_peer tun0 1 ${UDP_PEERS_FILE} ${MARK} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_multi_peer tun0 1 "${UDP_PEERS_FILE}" ${MARK} In test-mark.sh line 31: ip netns exec peer0 ${OVPN_CLI} new_key tun0 ${p} 1 0 ${ALG} 0 data64.key ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_key tun0 "${p}" 1 0 "${ALG}" 0 data64.key In test-mark.sh line 35: add_peer ${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: add_peer "${p}" In test-mark.sh line 39: ip netns exec peer0 ${OVPN_CLI} set_peer tun0 ${p} 60 120 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" set_peer tun0 "${p}" 60 120 In test-mark.sh line 40: ip netns exec peer${p} ${OVPN_CLI} set_peer tun${p} $((${p} + 9)) 60 120 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. Did you mean: ip netns exec peer"${p}" "${OVPN_CLI}" set_peer tun"${p}" $((${p} + 9)) 60 120 In test-mark.sh line 46: ip netns exec peer0 ping -qfc 500 -s 3000 -w 3 5.5.5.$((${p} + 1)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In test-mark.sh line 64: DROP_COUNTER=$(($DROP_COUNTER+$LOST_PACKETS)) ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In test-mark.sh line 69: [ ${DROP_COUNTER} -eq ${TOTAL_COUNT} ] || exit 1 ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "${DROP_COUNTER}" -eq "${TOTAL_COUNT}" ] || exit 1 In test-mark.sh line 76: ip netns exec peer0 ping -qfc 500 -s 3000 -w 3 5.5.5.$((${p} + 1)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. For more information: https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2004 -- $/${} is unnecessary on arithmeti... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/ovpn/common.sh - e3a67af2e113ee92dfb9cddd321874ac9c303e36744b0c6b1f1fc22173315989 In common.sh line 22: ip netns add peer${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns add peer"${1}" In common.sh line 28: if [ ${1} -eq 0 ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "${1}" -eq 0 ]; then In common.sh line 30: for p in $(seq 1 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 1 "${NUM_PEERS}"); do In common.sh line 31: ip link add veth${p} netns peer0 type veth peer name veth${p} netns peer${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add veth"${p}" netns peer0 type veth peer name veth"${p}" netns peer"${p}" In common.sh line 33: ip -n peer0 addr add 10.10.${p}.1/24 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 addr add 10.10."${p}".1/24 dev veth"${p}" In common.sh line 34: ip -n peer0 addr add fd00:0:0:${p}::1/64 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 addr add fd00:0:0:"${p}"::1/64 dev veth"${p}" In common.sh line 35: ip -n peer0 link set veth${p} up ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 link set veth"${p}" up In common.sh line 37: ip -n peer${p} addr add 10.10.${p}.2/24 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" addr add 10.10."${p}".2/24 dev veth"${p}" In common.sh line 38: ip -n peer${p} addr add fd00:0:0:${p}::2/64 dev veth${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" addr add fd00:0:0:"${p}"::2/64 dev veth"${p}" In common.sh line 39: ip -n peer${p} link set veth${p} up ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" link set veth"${p}" up In common.sh line 43: ip netns exec peer${1} ${OVPN_CLI} new_iface tun${1} $MODE ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" new_iface tun"${1}" $MODE In common.sh line 44: ip -n peer${1} addr add ${2} dev tun${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" addr add "${2}" dev tun"${1}" In common.sh line 46: if [ ${1} -eq 1 -a -n "${LAN_IP}" ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. Did you mean: if [ "${1}" -eq 1 -a -n "${LAN_IP}" ]; then In common.sh line 47: ip -n peer${1} addr add ${LAN_IP} dev tun${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" addr add ${LAN_IP} dev tun"${1}" In common.sh line 48: ip -n peer0 route add ${LAN_IP} via $(echo ${2} |sed -e s'!/.*!!') dev tun0 ^----------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 route add ${LAN_IP} via $(echo "${2}" |sed -e s'!/.*!!') dev tun0 In common.sh line 51: ip -n peer${1} link set mtu ${3} dev tun${1} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" link set mtu "${3}" dev tun"${1}" In common.sh line 53: ip -n peer${1} link set tun${1} up ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${1}" link set tun"${1}" up In common.sh line 62: PYTHONUNBUFFERED=1 ip netns exec peer${p} ${YNL_CLI} --family ovpn \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: PYTHONUNBUFFERED=1 ip netns exec peer"${p}" "${YNL_CLI}" --family ovpn \ In common.sh line 63: --subscribe peers --output-json --duration 40 > ${file} & ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: --subscribe peers --output-json --duration 40 > "${file}" & In common.sh line 72: if [ ${1} -eq 0 ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "${1}" -eq 0 ]; then In common.sh line 73: ip netns exec peer0 ${OVPN_CLI} new_multi_peer tun0 ${dev} 1 ${UDP_PEERS_FILE} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_multi_peer tun0 "${dev}" 1 "${UDP_PEERS_FILE}" In common.sh line 75: for p in $(seq 1 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 1 "${NUM_PEERS}"); do In common.sh line 76: ip netns exec peer0 ${OVPN_CLI} new_key tun0 ${p} 1 0 ${ALG} 0 \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_key tun0 "${p}" 1 0 "${ALG}" 0 \ In common.sh line 80: TX_ID=$(awk "NR == ${1} {print \$2}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: TX_ID=$(awk "NR == ${1} {print \$2}" "${UDP_PEERS_FILE}") In common.sh line 81: RADDR=$(awk "NR == ${1} {print \$3}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: RADDR=$(awk "NR == ${1} {print \$3}" "${UDP_PEERS_FILE}") In common.sh line 82: RPORT=$(awk "NR == ${1} {print \$4}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: RPORT=$(awk "NR == ${1} {print \$4}" "${UDP_PEERS_FILE}") In common.sh line 83: LPORT=$(awk "NR == ${1} {print \$6}" ${UDP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: LPORT=$(awk "NR == ${1} {print \$6}" "${UDP_PEERS_FILE}") In common.sh line 84: ip netns exec peer${1} ${OVPN_CLI} new_peer tun${1} ${dev} ${TX_ID} ${1} \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" new_peer tun"${1}" "${dev}" "${TX_ID}" "${1}" \ In common.sh line 85: ${LPORT} ${RADDR} ${RPORT} ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${LPORT}" "${RADDR}" "${RPORT}" In common.sh line 86: ip netns exec peer${1} ${OVPN_CLI} new_key tun${1} ${TX_ID} 1 0 \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" new_key tun"${1}" "${TX_ID}" 1 0 \ In common.sh line 87: ${ALG} 1 data64.key ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${ALG}" 1 data64.key In common.sh line 90: if [ ${1} -eq 0 ]; then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "${1}" -eq 0 ]; then In common.sh line 91: (ip netns exec peer0 ${OVPN_CLI} listen tun0 1 ${TCP_PEERS_FILE} && { ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: (ip netns exec peer0 "${OVPN_CLI}" listen tun0 1 "${TCP_PEERS_FILE}" && { In common.sh line 92: for p in $(seq 1 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 1 "${NUM_PEERS}"); do In common.sh line 93: ip netns exec peer0 ${OVPN_CLI} new_key tun0 ${p} 1 0 \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_key tun0 "${p}" 1 0 \ In common.sh line 94: ${ALG} 0 data64.key ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${ALG}" 0 data64.key In common.sh line 99: TX_ID=$(awk "NR == ${1} {print \$2}" ${TCP_PEERS_FILE}) ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: TX_ID=$(awk "NR == ${1} {print \$2}" "${TCP_PEERS_FILE}") In common.sh line 100: ip netns exec peer${1} ${OVPN_CLI} connect tun${1} ${TX_ID} ${1} \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${1}" "${OVPN_CLI}" connect tun"${1}" "${TX_ID}" "${1}" \ In common.sh line 101: 10.10.${1}.1 1 data64.key ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: 10.10."${1}".1 1 data64.key In common.sh line 112: kill -TERM ${listener_pids[$1]} || true ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill -TERM "${listener_pids[$1]}" || true In common.sh line 113: wait ${listener_pids[$1]} || true ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait "${listener_pids[$1]}" || true In common.sh line 114: printf "Checking notifications for peer ${1}... " ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In common.sh line 115: diff <(jq -s "${JQ_FILTER}" ${expexted}) \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: diff <(jq -s "${JQ_FILTER}" "${expexted}") \ In common.sh line 116: <(jq -s "${JQ_FILTER}" ${received}) ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: <(jq -s "${JQ_FILTER}" "${received}") In common.sh line 119: rm -f ${received} || true ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -f "${received}" || true In common.sh line 125: killall $(basename ${OVPN_CLI}) 2>/dev/null || true ^---------------------^ SC2046 (warning): Quote this to prevent word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: killall $(basename "${OVPN_CLI}") 2>/dev/null || true In common.sh line 129: ip -n peer${p} link set tun${p} down 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer"${p}" link set tun"${p}" down 2>/dev/null || true In common.sh line 130: ip netns exec peer${p} ${OVPN_CLI} del_iface tun${p} 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer"${p}" "${OVPN_CLI}" del_iface tun"${p}" 2>/dev/null || true In common.sh line 133: ip -n peer0 link del veth${p} 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -n peer0 link del veth"${p}" 2>/dev/null || true In common.sh line 136: ip netns del peer${p} 2>/dev/null || true ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns del peer"${p}" 2>/dev/null || true In common.sh line 141: NUM_PEERS=${NUM_PEERS:-$(wc -l ${UDP_PEERS_FILE} | awk '{print $1}')} ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NUM_PEERS=${NUM_PEERS:-$(wc -l "${UDP_PEERS_FILE}" | awk '{print $1}')} In common.sh line 143: NUM_PEERS=${NUM_PEERS:-$(wc -l ${TCP_PEERS_FILE} | awk '{print $1}')} ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NUM_PEERS=${NUM_PEERS:-$(wc -l "${TCP_PEERS_FILE}" | awk '{print $1}')} For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... Checking tools/testing/selftests/net/ovpn/test-bind.sh - 70aeb75419a8adfceadd178a88a280a67f3a4155209936ed9202f6c499816112 In test-bind.sh line 38: ip netns exec peer1 ${OVPN_CLI} new_iface tun1 P2P ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer1 "${OVPN_CLI}" new_iface tun1 P2P In test-bind.sh line 39: ip netns exec peer2 ${OVPN_CLI} new_iface tun2 P2P ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer2 "${OVPN_CLI}" new_iface tun2 P2P In test-bind.sh line 58: ip netns exec peer1 ${OVPN_CLI} del_peer tun1 1 2>/dev/null || true ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer1 "${OVPN_CLI}" del_peer tun1 1 2>/dev/null || true In test-bind.sh line 59: ip netns exec peer2 ${OVPN_CLI} del_peer tun2 10 2>/dev/null || true ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer2 "${OVPN_CLI}" del_peer tun2 10 2>/dev/null || true In test-bind.sh line 62: killall $(basename ${OVPN_CLI}) 2>/dev/null || true ^---------------------^ SC2046 (warning): Quote this to prevent word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: killall $(basename "${OVPN_CLI}") 2>/dev/null || true In test-bind.sh line 64: ip netns exec peer1 ${OVPN_CLI} new_peer tun1 ${dev1} 1 10 1 ${raddr4_peer1} 1 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer1 "${OVPN_CLI}" new_peer tun1 "${dev1}" 1 10 1 "${raddr4_peer1}" 1 In test-bind.sh line 65: ip netns exec peer1 ${OVPN_CLI} new_key tun1 1 1 0 ${ALG} 0 data64.key ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer1 "${OVPN_CLI}" new_key tun1 1 1 0 "${ALG}" 0 data64.key In test-bind.sh line 66: ip netns exec peer2 ${OVPN_CLI} new_peer tun2 ${dev2} 10 1 1 ${raddr4_peer2} 1 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer2 "${OVPN_CLI}" new_peer tun2 "${dev2}" 10 1 1 "${raddr4_peer2}" 1 In test-bind.sh line 67: ip netns exec peer2 ${OVPN_CLI} new_key tun2 10 1 0 ${ALG} 1 data64.key ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer2 "${OVPN_CLI}" new_key tun2 10 1 0 "${ALG}" 1 data64.key In test-bind.sh line 69: ip netns exec peer1 ${OVPN_CLI} set_peer tun1 1 60 120 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer1 "${OVPN_CLI}" set_peer tun1 1 60 120 In test-bind.sh line 70: ip netns exec peer2 ${OVPN_CLI} set_peer tun2 10 60 120 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer2 "${OVPN_CLI}" set_peer tun2 10 60 120 For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... Checking tools/testing/selftests/net/ovpn/test-mark.sh - 62413f616b2d8c2c30c9460fb0e3f9143841b79f6c88f785583b2a23156390a9 In test-mark.sh line 20: for p in $(seq 0 ${NUM_PEERS}); do ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for p in $(seq 0 "${NUM_PEERS}"); do In test-mark.sh line 21: create_ns ${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: create_ns "${p}" In test-mark.sh line 25: setup_ns ${p} 5.5.5.$((${p} + 1))/24 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. Did you mean: setup_ns "${p}" 5.5.5.$((${p} + 1))/24 In test-mark.sh line 29: ip netns exec peer0 ${OVPN_CLI} new_multi_peer tun0 any 1 ${UDP_PEERS_FILE} ${MARK} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_multi_peer tun0 any 1 "${UDP_PEERS_FILE}" ${MARK} In test-mark.sh line 31: ip netns exec peer0 ${OVPN_CLI} new_key tun0 ${p} 1 0 ${ALG} 0 data64.key ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" new_key tun0 "${p}" 1 0 "${ALG}" 0 data64.key In test-mark.sh line 35: add_peer ${p} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: add_peer "${p}" In test-mark.sh line 39: ip netns exec peer0 ${OVPN_CLI} set_peer tun0 ${p} 60 120 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec peer0 "${OVPN_CLI}" set_peer tun0 "${p}" 60 120 In test-mark.sh line 40: ip netns exec peer${p} ${OVPN_CLI} set_peer tun${p} $((${p} + 9)) 60 120 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. Did you mean: ip netns exec peer"${p}" "${OVPN_CLI}" set_peer tun"${p}" $((${p} + 9)) 60 120 In test-mark.sh line 46: ip netns exec peer0 ping -qfc 500 -s 3000 -w 3 5.5.5.$((${p} + 1)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In test-mark.sh line 64: DROP_COUNTER=$(($DROP_COUNTER+$LOST_PACKETS)) ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In test-mark.sh line 69: [ ${DROP_COUNTER} -eq ${TOTAL_COUNT} ] || exit 1 ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "${DROP_COUNTER}" -eq "${TOTAL_COUNT}" ] || exit 1 In test-mark.sh line 76: ip netns exec peer0 ping -qfc 500 -s 3000 -w 3 5.5.5.$((${p} + 1)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. For more information: https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2004 -- $/${} is unnecessary on arithmeti...