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.SCDwpIaAP2 and /tmp/tmp.DvdiRsNjBb Tree base: 34406b4cf517 ("selftests: netfilter: add conntrack clash resolution test case") Now at: 2f2da3edef62 ("selftests: netfilter: conntrack_resize.sh: also use udpclash tool") ====== Checking before the patch ====== 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 201: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 204: 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 225: local now=$(date +%s) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In conntrack_resize.sh line 228: 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 250: read tainted_now < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 266: r=$((RANDOM%$insert_count)) ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In conntrack_resize.sh line 285: read tainted_then < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 287: 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 336: 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 372: read tainted_then < /proc/sys/kernel/tainted ^--^ SC2162 (info): read without -r will mangle backslashes. In conntrack_resize.sh line 408: 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 409: 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 428: 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 453: 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 474: 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_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 ...