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.JQnCVrgEov and /tmp/tmp.M4D0y3m8zM Tree base: a6099f263e1f ("net: ethernet: ti: am65-cpsw-nuss: Fix null pointer dereference for ndev") Now at: 3f9c030464ad ("selftests: netfilter: fix udpclash tool hang") ====== Checking before the patch ====== Checking tools/testing/selftests/net/netfilter/conntrack_clash.sh - a00afbba902107e2b49d2d5f043fa4339644dd960e3ac6bdd6eaf88e1106a0e3 In conntrack_clash.sh line 24: ip netns exec "$nsrouter" nft -f -</dev/null & ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec "$ns" socat UDP-RECVFROM:"$port",fork PIPE 2>/dev/null & In conntrack_clash.sh line 67: wait_local_port_listen "$ns" $port udp ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_local_port_listen "$ns" "$port" udp In conntrack_clash.sh line 87: if ! ip netns exec "$ns" ping -q -c 1 $daddr > /dev/null;then ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip netns exec "$ns" ping -q -c 1 "$daddr" > /dev/null;then In conntrack_clash.sh line 102: if ! ip netns exec "$ns" ./udpclash $daddr $dport;then ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip netns exec "$ns" ./udpclash "$daddr" "$dport";then In conntrack_clash.sh line 109: cre=$(ip netns exec "$ctns" conntrack -S | grep "clash_resolve=0" | wc -l) ^--------------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. In conntrack_clash.sh line 144: ip link add veth0 netns "$nsclient1" type veth peer name veth0 netns "$nsrouter" ^--------^ SC2154 (warning): nsclient1 is referenced but not assigned. In conntrack_clash.sh line 145: ip link add veth0 netns "$nsclient2" type veth peer name veth1 netns "$nsrouter" ^--------^ SC2154 (warning): nsclient2 is referenced but not assigned. For more information: https://www.shellcheck.net/wiki/SC2154 -- nsclient1 is referenced but not a... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2126 -- Consider using 'grep -c' instead ... Checking tools/testing/selftests/net/netfilter/conntrack_resize.sh - 392c98dd48bf5e412c199e4798a498deb4fc287f87e0da4e649ef96df46a4b4f In conntrack_resize.sh line 25: exit $KSFT_SKIP ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2153 (info): Possible misspelling: KSFT_SKIP may not be assigned. Did you mean ksft_skip? Did you mean: exit "$KSFT_SKIP" In conntrack_resize.sh line 37: sysctl -q net.netfilter.nf_conntrack_max=$init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sysctl -q net.netfilter.nf_conntrack_max="$init_net_max" In conntrack_resize.sh line 38: sysctl -q net.netfilter.nf_conntrack_buckets=$ct_buckets ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sysctl -q net.netfilter.nf_conntrack_buckets="$ct_buckets" In conntrack_resize.sh line 47: local lv=$(sysctl -n net.nf_conntrack_max) ^-- SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 49: if [ $expected -ne "$lv" ];then ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$expected" -ne "$lv" ];then In conntrack_resize.sh line 61: while [ $i -lt $count ] ;do ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ $i -lt "$count" ] ;do In conntrack_resize.sh line 79: local now=$(ip netns exec "$ns" conntrack -C) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 81: if [ $now -ne "$count" ] ;then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$now" -ne "$count" ] ;then In conntrack_resize.sh line 91: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 94: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 117: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 122: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 134: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 139: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 162: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 167: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 184: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 189: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 217: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 220: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 241: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 244: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 266: read tainted_now < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 282: r=$((RANDOM%$insert_count)) ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In conntrack_resize.sh line 302: read tainted_then < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 304: for n in "$nsclient1" "$nsclient2";do ^--------^ SC2154 (warning): nsclient1 is referenced but not assigned. ^--------^ SC2154 (warning): nsclient2 is referenced but not assigned. In conntrack_resize.sh line 353: proto=$(ip netns exec "$ns" conntrack -L --proto $protoname 2>/dev/null | sort | uniq | tee "$tmpfile_uniq" | wc -l) ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: proto=$(ip netns exec "$ns" conntrack -L --proto "$protoname" 2>/dev/null | sort | uniq | tee "$tmpfile_uniq" | wc -l) In conntrack_resize.sh line 389: read tainted_then < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 425: if [ $o -ne $n ]; then ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$o" -ne "$n" ]; then In conntrack_resize.sh line 426: if [ $failhard -gt 0 ] ;then ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$failhard" -gt 0 ] ;then In conntrack_resize.sh line 445: sysctl -q net.netfilter.nf_conntrack_max=$init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sysctl -q net.netfilter.nf_conntrack_max="$init_net_max" In conntrack_resize.sh line 470: check_max_alias $init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_max_alias "$init_net_max" In conntrack_resize.sh line 491: ip netns exec "$nsclient1" sysctl -q net.netfilter.nf_conntrack_max=$init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec "$nsclient1" sysctl -q net.netfilter.nf_conntrack_max="$init_net_max" For more information: https://www.shellcheck.net/wiki/SC2154 -- nsclient1 is referenced but not a... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/netfilter/conntrack_clash.sh - a00afbba902107e2b49d2d5f043fa4339644dd960e3ac6bdd6eaf88e1106a0e3 In conntrack_clash.sh line 24: ip netns exec "$nsrouter" nft -f -</dev/null & ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec "$ns" socat UDP-RECVFROM:"$port",fork PIPE 2>/dev/null & In conntrack_clash.sh line 67: wait_local_port_listen "$ns" $port udp ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_local_port_listen "$ns" "$port" udp In conntrack_clash.sh line 87: if ! ip netns exec "$ns" ping -q -c 1 $daddr > /dev/null;then ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip netns exec "$ns" ping -q -c 1 "$daddr" > /dev/null;then In conntrack_clash.sh line 102: if ! ip netns exec "$ns" timeout 30 ./udpclash $daddr $dport;then ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip netns exec "$ns" timeout 30 ./udpclash "$daddr" "$dport";then In conntrack_clash.sh line 109: cre=$(ip netns exec "$ctns" conntrack -S | grep "clash_resolve=0" | wc -l) ^--------------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. In conntrack_clash.sh line 144: ip link add veth0 netns "$nsclient1" type veth peer name veth0 netns "$nsrouter" ^--------^ SC2154 (warning): nsclient1 is referenced but not assigned. In conntrack_clash.sh line 145: ip link add veth0 netns "$nsclient2" type veth peer name veth1 netns "$nsrouter" ^--------^ SC2154 (warning): nsclient2 is referenced but not assigned. For more information: https://www.shellcheck.net/wiki/SC2154 -- nsclient1 is referenced but not a... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2126 -- Consider using 'grep -c' instead ... Checking tools/testing/selftests/net/netfilter/conntrack_resize.sh - 392c98dd48bf5e412c199e4798a498deb4fc287f87e0da4e649ef96df46a4b4f In conntrack_resize.sh line 25: exit $KSFT_SKIP ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2153 (info): Possible misspelling: KSFT_SKIP may not be assigned. Did you mean ksft_skip? Did you mean: exit "$KSFT_SKIP" In conntrack_resize.sh line 37: sysctl -q net.netfilter.nf_conntrack_max=$init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sysctl -q net.netfilter.nf_conntrack_max="$init_net_max" In conntrack_resize.sh line 38: sysctl -q net.netfilter.nf_conntrack_buckets=$ct_buckets ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sysctl -q net.netfilter.nf_conntrack_buckets="$ct_buckets" In conntrack_resize.sh line 47: local lv=$(sysctl -n net.nf_conntrack_max) ^-- SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 49: if [ $expected -ne "$lv" ];then ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$expected" -ne "$lv" ];then In conntrack_resize.sh line 61: while [ $i -lt $count ] ;do ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ $i -lt "$count" ] ;do In conntrack_resize.sh line 79: local now=$(ip netns exec "$ns" conntrack -C) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 81: if [ $now -ne "$count" ] ;then ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$now" -ne "$count" ] ;then In conntrack_resize.sh line 91: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 94: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 117: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 122: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 134: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 139: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 162: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 167: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 184: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 189: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 217: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 220: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 241: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 244: while [ $now -lt $end ]; do ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "$now" -lt $end ]; do In conntrack_resize.sh line 266: read tainted_now < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 283: r=$((RANDOM%$insert_count)) ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In conntrack_resize.sh line 303: read tainted_then < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 305: for n in "$nsclient1" "$nsclient2";do ^--------^ SC2154 (warning): nsclient1 is referenced but not assigned. ^--------^ SC2154 (warning): nsclient2 is referenced but not assigned. In conntrack_resize.sh line 354: proto=$(ip netns exec "$ns" conntrack -L --proto $protoname 2>/dev/null | sort | uniq | tee "$tmpfile_uniq" | wc -l) ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: proto=$(ip netns exec "$ns" conntrack -L --proto "$protoname" 2>/dev/null | sort | uniq | tee "$tmpfile_uniq" | wc -l) In conntrack_resize.sh line 390: read tainted_then < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 426: if [ $o -ne $n ]; then ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$o" -ne "$n" ]; then In conntrack_resize.sh line 427: if [ $failhard -gt 0 ] ;then ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$failhard" -gt 0 ] ;then In conntrack_resize.sh line 446: sysctl -q net.netfilter.nf_conntrack_max=$init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sysctl -q net.netfilter.nf_conntrack_max="$init_net_max" In conntrack_resize.sh line 471: check_max_alias $init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_max_alias "$init_net_max" In conntrack_resize.sh line 492: ip netns exec "$nsclient1" sysctl -q net.netfilter.nf_conntrack_max=$init_net_max ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec "$nsclient1" sysctl -q net.netfilter.nf_conntrack_max="$init_net_max" For more information: https://www.shellcheck.net/wiki/SC2154 -- nsclient1 is referenced but not a... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...