0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 04:02:15 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Lev Stipakov
0b02023a53
agent win: remove __DATE__ and __TIME__
This is required for deterministic builds.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-05-27 12:14:24 +03:00
Lev Stipakov
faf9bd46c8
windows agent: install bypass route if host hasn't changed
We skipped bypass route installation if new host address is the same
as previous one. This didin't take into account case when network
has changed and gateway for the host could change.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-10-07 19:46:19 +02:00
Lev Stipakov
d8e99cf5c1 win: improve "add bypass route" logic
When adding bypass route to remote we always use
default gateway. This doesn't work when remote is not
reachable via default gateway (local network,
custom route - OVPN3-653).

Implement "get best gateway" logic by traversing routing
table and find gateway with longest prefix match and
highest metric.

In case of seamless tunnel and redirect-gw "get best gateway"
will return VPN gateway when adding bypass route during reconnect
to another remote. VPN tunnel is likely broken at this point
and bypass route via VPN make reconnect impossible.

Fix that by storing VPN interface index and, when finding best gateway,
filter routes which use VPN interface.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-09-16 18:08:15 +03:00
Arne Schwabe
012e7e8226
Refactor InitProcess to use refcounting
Although the init calls were protected by a mutex more than consumer of
the API will the second one if the uninit was called too early.

While at it, move from explicit init/uninit calls to RAII.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-09-02 20:37:01 +02:00
Lev Stipakov
7cf2e210d1
mingw: fix various warnings
- remove unused variable
 - replace deprecated JsonReader with CharReader
 - fix initialization order
 - fix signed-unsigned comparison
 - fix string constant to char* conversion
 - fix unknown (to mingw) format character
 - fix passing NULL to non-pointer agrument
 - remove unneeded #pragma once

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:40 +01:00
Lev Stipakov
67fb123b88
ovpnagent: start openvpn process
This is needed to make openvpn-gui client work with openpvn3.

openvpn-gui passes all information, required to start vpn session,
to agent via named pipe. Agent impersonates another end of pipe,
which is gui process, running under user privileges, and starts
openvpn process.

openvpn-gui generates a random password, which is written by agent
into openvpn process's stdin. That password is used by openvpn-gui to
connect to openvpn's management interface.

openvpn-gui creates an event with unique name, which it is passed
to openvpn via command line. When user disconnects VPN session, gui
sets event into signalled state. openvpn waits on event and, when it is signalled, quits.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-05 19:41:54 +01:00
Lev Stipakov
1976c639c1
cmake: add Windows agent build
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-03 11:38:17 +02:00
Lev Stipakov
10127e2bdd
Add GPL headers
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-01-31 10:24:38 +02:00
Lev Stipakov
21aa8b7c99
ovpnagent.cpp: move to another directory
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-01-31 10:24:14 +02:00