Skip to content

Commit 0bb4963

Browse files
committed
openconnect: fix off-by-one while condition
resolveip returns 0 on success. This means that the while loop will just run until all tries are exhausted. But this was not the intended behaviour. Fixes: 20ea726 ("openconnect: make host dependency more resilient") Signed-off-by: Christian Lamparter <[email protected]>
1 parent 57242e5 commit 0bb4963

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/openconnect/files/openconnect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ proto_openconnect_setup() {
8686
[ -n $uri ] && server=$(echo $uri | awk -F[/:] '{print $4}')
8787

8888
logger -t "openconnect" "adding host dependency for $server at $config"
89-
while resolveip -t 10 "$server" > "$tmpfile" && [ "$trials" -gt 0 ]; do
89+
while ! resolveip -t 10 "$server" > "$tmpfile" && [ "$trials" -gt 0 ]; do
9090
sleep 5
9191
trials=$((trials - 1))
9292
done

0 commit comments

Comments
 (0)