Custom "pre"/"down" scripts run for hop tunnels (h != 1 compares string to int) #81

Open
opened 2026-08-20 00:38:50 -04:00 by mysticalsoap · 0 comments
Owner

In ovpn(), both remaining guards read "bypass" not in self.server_dict and h != 1 — but h is a string ("0"/"1"/"2" from the server dict), so h != 1 is always true and the provider's custom "pre" and "down" scripts also fire for hop connects: "pre" before the hop even dials, "down" again when the hop tears down.

The same bug in tunnel_up ran the "up" script on hop connects; #79 fixed that one in passing (the guard is now role == "main"). The two ovpn() sites were deliberately left untouched there to keep scope.

Fix: same shape — guard on role == "main" instead of the h/dict combination.

In `ovpn()`, both remaining guards read `"bypass" not in self.server_dict and h != 1` — but `h` is a string (`"0"`/`"1"`/`"2"` from the server dict), so `h != 1` is always true and the provider's custom "pre" and "down" scripts also fire for hop connects: "pre" before the hop even dials, "down" again when the hop tears down. The same bug in `tunnel_up` ran the "up" script on hop connects; #79 fixed that one in passing (the guard is now `role == "main"`). The two `ovpn()` sites were deliberately left untouched there to keep scope. Fix: same shape — guard on `role == "main"` instead of the `h`/dict combination.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#81
No description provided.