YunoHost-Apps / hotspot_ynh

Wifi Hotspot app for YunoHost
GNU Affero General Public License v3.0
39 stars 19 forks source link

Race condition at boot with VPN client #119

Closed hidrarga closed 7 months ago

hidrarga commented 7 months ago

Problem

There is a race condition at boot, when both vpnclient and hotspot services are starting:

  1. The hotspot check what's the gateway interface and detects that it is eth0. It configures the NAT rule according on this interface.
  2. The VPN client starts, and thus the gateway interface changes to tun0
  3. The VPN attempts to changes the NAT rules with the correct gateway interface, but detects that the hotspot isn't active (it's activating).

When both services are done, there is no access to internet when connected to the hotspot, because the NAT rule is incorrect.

Solution

There is probably a better solution than this, but here I just patch it by checking in the OpenVPN hook if the hotspot is active or activating.

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

hidrarga commented 7 months ago

!testme

yunohost-bot commented 7 months ago

:v: Test Badge