~connman-maintainers/connman/head

Viewing all changes in revision 8140.

  • Committer: Daniel Wagner
  • Author(s): Jussi Laakkonen
  • Date: 2021-08-30 17:01:12 UTC
  • Revision ID: git-v1:b2ffe8a24d6a2b9ed82a05da5ba84cbd4fb0d7d1
vpn-provider: Implement connmand online state checking

Add a complete mechanism to track connmand state and query it if
necessary to avoid connecting VPNs when there is either no connmand or
no network to use. This also makes VPNs to disconnect when connmand
loses its online state or disappears.

The connmand state listener uses net.connman.Manager interface to get
the state using GetProperties at startup. PropertyChanged signal is
monitored for state changes to update the state. State is changed and
queried when the D-Bus service listener is notified. Connmand state is
tracked within vpnd with a boolean: "true" = online/ready, "false" =
offline/idle.

Also a feature to support delayed connecting of VPNs is added. It may
happen in a situation where ConnMan status is not queried yet and
a request to connect is received over D-Bus. In this case a timeout
function is added to the main loop that runs with 1s interval. When the
delayed connect function is running it keeps on trying until connmand
state is online/ready. If connection request comes when the state is
queried and it is not online/ready ENOLINK is returned as an error
("NoCarrier" D-Bus msg). The delayed connect function is removed if
connect request comes when the function is waiting to be scheduled and
the VPN in question is connected immediately.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: