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.KPuZD33Ngs and /tmp/tmp.q878Y34D9c Tree base: 3b5b1c428260 ("eth: gianfar: migrate to new RXFH callbacks") Now at: 0ffae1824a58 ("selftests: netfilter: Add bridge_fastpath.sh") ====== Checking before the patch ====== ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/netfilter/bridge_fastpath.sh - 32dd7f85aa1f39e0d6ca4cb4db31698349192a11044725806a91cd0efaa2fae4 In bridge_fastpath.sh line 102: nsa=( $nsclientwan $nsclientlan1 $nsclientlan2 ) # $nsrt $nsrt ^----------^ SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. ^-----------^ SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. ^-----------^ SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. In bridge_fastpath.sh line 112: vethcl[$WAN]="${1%,*}" ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 113: vethrt[$WAN]="${1#*,}" ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 117: vethcl[$LAN1]="${1%,*}" ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 118: vethrt[$LAN1]="${1#*,}" ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 122: vethcl[$LAN2]="${1%,*}" ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 123: vethrt[$LAN2]="${1#*,}" ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 153: Usage: $(basename $0) [OPTION]... ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: Usage: $(basename "$0") [OPTION]... In bridge_fastpath.sh line 172: tests[$i]="yes" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 177: touch /var/run/netns/$nsrt ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: touch /var/run/netns/"$nsrt" In bridge_fastpath.sh line 178: mount --bind /proc/1/ns/net /var/run/netns/$nsrt ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mount --bind /proc/1/ns/net /var/run/netns/"$nsrt" In bridge_fastpath.sh line 182: nsa+=($nsrt $nsrt) ^---^ SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. ^---^ SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. In bridge_fastpath.sh line 186: umount /var/run/netns/$nsrt ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: umount /var/run/netns/"$nsrt" In bridge_fastpath.sh line 187: rm -f /var/run/netns/$nsrt ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -f /var/run/netns/"$nsrt" In bridge_fastpath.sh line 195: head -c $(($filesize * 1024 * 1024)) < /dev/urandom > "$filein" ^-------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 207: if [[ ! "$othermacs" =~ "$mac" ]]; then ^----^ SC2076 (warning): Remove quotes from right-hand side of =~ to match as a regex rather than literally. In bridge_fastpath.sh line 208: echo $mac ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$mac" In bridge_fastpath.sh line 216: mac="${mac::6}$(printf %02x:%02x:%02x:%02x $(($RANDOM%256)) \ ^-----^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 217: $(($RANDOM%256)) $(($RANDOM%256)) $(($RANDOM%256)))" ^-----^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-----^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-----^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 218: [[ "$othermacs" =~ "$mac" ]] && continue ^----^ SC2076 (warning): Remove quotes from right-hand side of =~ to match as a regex rather than literally. In bridge_fastpath.sh line 219: echo $mac ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$mac" In bridge_fastpath.sh line 231: if [ -n "$(ip -net "$ns" link show dev "$dev" up 2>/dev/null | \ ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ]. In bridge_fastpath.sh line 241: local all="${@:2}" ^------^ SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. In bridge_fastpath.sh line 247: ip -net "$ns" link set "${vethcl[$i]}" $arg ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns" link set "${vethcl[$i]}" "$arg" In bridge_fastpath.sh line 248: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 249: ip -net "$nsrt" link set "${vethrt[$i]}" $arg ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$nsrt" link set "${vethrt[$i]}" "$arg" In bridge_fastpath.sh line 250: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 256: for j in $(seq 1 $(($LINKUP_TIMEOUT * 5 ))); do ^-------------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 260: is_linkup $ns "${vethcl[$i]}" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: is_linkup "$ns" "${vethcl[$i]}" In bridge_fastpath.sh line 261: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 262: is_linkup $nsrt "${vethrt[$i]}" ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: is_linkup "$nsrt" "${vethrt[$i]}" In bridge_fastpath.sh line 263: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 278: for j in $(seq 1 $(($PING_TIMEOUT * 5 ))); do ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 281: [ $? -le 1 ] && return $? ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. In bridge_fastpath.sh line 335: unset_client $i ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: unset_client "$i" In bridge_fastpath.sh line 343: add_addr $i "$vdev.$VID1.$VID2" ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: add_addr "$i" "$vdev.$VID1.$VID2" In bridge_fastpath.sh line 350: ip -net "$ns" link add "$brdev" type bridge vlan_filtering 1 vlan_default_pvid 0 $proto ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns" link add "$brdev" type bridge vlan_filtering 1 vlan_default_pvid 0 "$proto" In bridge_fastpath.sh line 355: bridge -net "$ns" vlan add dev "$vdev" vid $VID1 $pvidslave ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: bridge -net "$ns" vlan add dev "$vdev" vid $VID1 "$pvidslave" In bridge_fastpath.sh line 364: add_addr $i "$brdev" ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: add_addr "$i" "$brdev" In bridge_fastpath.sh line 396: -I $dev1 -X "$pppoeserverpid" -O "$pppoeserveroptions" >/dev/null; then ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: -I "$dev1" -X "$pppoeserverpid" -O "$pppoeserveroptions" >/dev/null; then In bridge_fastpath.sh line 401: if ! ip netns exec "$ns2" pppd plugin pppoe.so nic-$dev2 persist holdoff 0 noauth \ ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip netns exec "$ns2" pppd plugin pppoe.so nic-"$dev2" persist holdoff 0 noauth \ In bridge_fastpath.sh line 408: if ! wait_ping $i1 $i2; 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 ! wait_ping "$i1" "$i2"; then In bridge_fastpath.sh line 413: ppp2=$(cat "/run/pppd/ppp-selftest-$$.pid" | tail -n 1) ^-----------------------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. In bridge_fastpath.sh line 433: kill -9 $(cat "/run/pppd/ppp-selftest-$$.pid" | head -n 1) \ ^-- SC2046 (warning): Quote this to prevent word splitting. ^-----------------------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. In bridge_fastpath.sh line 434: $(cat "$pppoeserverpid" | head -n 1) ^-- SC2046 (warning): Quote this to prevent word splitting. ^---------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. In bridge_fastpath.sh line 442: ss -N "$ns" --ipv$ipv -lnt -o "sport = :8080" | grep -q 8080 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ss -N "$ns" --ipv"$ipv" -lnt -o "sport = :8080" | grep -q 8080 In bridge_fastpath.sh line 480: timeout "$SOCAT_TIMEOUT" ip netns exec "$ns1" socat TCP$ipv:$a:8080 \ ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: timeout "$SOCAT_TIMEOUT" ip netns exec "$ns1" socat TCP$ipv:"$a":8080 \ In bridge_fastpath.sh line 484: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In bridge_fastpath.sh line 485: error[$i]="ipv$ipv: tcp broken" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 489: error[$i]="ipv$ipv: file mismatch to ${ad}" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 493: error[$i]="ipv$ipv: file mismatch from ${ad}" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 497: limit=$((2 * $filesize * 1024 * 1024)) ^-------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 502: error[$i]="ipv$ipv: established bytes $bytes < $limit" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 507: error[$i]="ipv$ipv: counted bytes $bytes > $((limit/2))" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 538: if ! setup_nftables $i1 $i2; 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 ! setup_nftables "$i1" "$i2"; then In bridge_fastpath.sh line 542: if ! test_tcp $i1 $i2 "" "$desc without fastpath"; 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 ! test_tcp "$i1" "$i2" "" "$desc without fastpath"; then In bridge_fastpath.sh line 546: if ! setup_fastpath $i1 $i2 "" 2>/dev/null; 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 ! setup_fastpath "$i1" "$i2" "" 2>/dev/null; then In bridge_fastpath.sh line 549: if ! test_tcp $i1 $i2 "fast" "$desc with fastpath"; 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 ! test_tcp "$i1" "$i2" "fast" "$desc with fastpath"; then In bridge_fastpath.sh line 553: if ! setup_fastpath $i1 $i2 "hw" 2>/dev/null; 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 ! setup_fastpath "$i1" "$i2" "hw" 2>/dev/null; then In bridge_fastpath.sh line 556: if ! test_tcp $i1 $i2 "fast" "$desc with hw_fastpath"; 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 ! test_tcp "$i1" "$i2" "fast" "$desc with hw_fastpath"; then In bridge_fastpath.sh line 663: set_client $i none ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" none In bridge_fastpath.sh line 667: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 670: set_client $i q ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" q In bridge_fastpath.sh line 674: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 677: set_client $i qq ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" qq In bridge_fastpath.sh line 684: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 687: set_client $i ad ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" ad In bridge_fastpath.sh line 691: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 701: set_client $i none noaddress ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" none noaddress In bridge_fastpath.sh line 706: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 712: set_client $i q noaddress ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" q noaddress In bridge_fastpath.sh line 717: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 726: unset_client $i ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: unset_client "$i" In bridge_fastpath.sh line 738: set_client $i none ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" none In bridge_fastpath.sh line 741: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 749: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 757: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 765: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 787: set_client $i none ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" none In bridge_fastpath.sh line 791: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 794: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 800: set_client $i q ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_client "$i" q In bridge_fastpath.sh line 804: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 807: lret=$(($lret | $?)) ^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 812: unset_client $i ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: unset_client "$i" In bridge_fastpath.sh line 829: unset_client $i ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: unset_client "$i" In bridge_fastpath.sh line 831: return $lret ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$lret" In bridge_fastpath.sh line 845: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 847: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 861: vethcl[$i]="veth${i}cl" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 862: vethrt[$i]="veth${i}rt" ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 865: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 868: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 870: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 888: $(printf "%14.14s" ${vethrt[$LAN1]}) ${vethrt[$LAN2]} ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: $(printf "%14.14s" "${vethrt[$LAN1]}") ${vethrt[$LAN2]} In bridge_fastpath.sh line 890: $(printf "%14.14s" ${vethcl[$LAN1]}) ${vethcl[$LAN2]} ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: $(printf "%14.14s" "${vethcl[$LAN1]}") ${vethcl[$LAN2]} In bridge_fastpath.sh line 901: mac=$(check_mac $ns ${vethcl[$i]} "$routerside $clientside") ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mac=$(check_mac "$ns" "${vethcl[$i]}" "$routerside $clientside") In bridge_fastpath.sh line 902: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 904: mac=$(check_mac $nsrt ${vethrt[$i]} "$clientside") ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mac=$(check_mac "$nsrt" "${vethrt[$i]}" "$clientside") In bridge_fastpath.sh line 905: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 915: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 928: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In bridge_fastpath.sh line 935: tests[3]=""; test[4]=""; tests[5]="" ^-----^ SC2034 (warning): test appears unused. Verify use (or export if used externally). In bridge_fastpath.sh line 949: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 967: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 974: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 988: ret=$(($ret | $?)) ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In bridge_fastpath.sh line 999: unset_client $i ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: unset_client "$i" For more information: https://www.shellcheck.net/wiki/SC2034 -- test appears unused. Verify use (... https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2076 -- Remove quotes from right-hand sid...