mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-19 19:52:15 +02:00
tunbuilder: add support for client-side push-updates
This implements apply_push_update() method for tunbuilder tun client. For tunbuilder tun client, no specific actions are required except calling stop() and tun_start(). This will undo existing options and apply the merged ones. Signed-off-by: Lev Stipakov <lev@openvpn.net>
This commit is contained in:
parent
ce68e3c415
commit
906434b237
@ -280,6 +280,23 @@ class Client : public TunClient
|
||||
stop_();
|
||||
}
|
||||
|
||||
void apply_push_update(const OptionList &opt, TransportClient &transcli) override
|
||||
{
|
||||
stop_();
|
||||
if (impl)
|
||||
{
|
||||
impl.reset();
|
||||
}
|
||||
|
||||
// this has to be done in post, because we need to wait
|
||||
// for all async tun read requests to complete
|
||||
openvpn_io::post(io_context, [self = Ptr(this), opt, &transcli]
|
||||
{
|
||||
OPENVPN_ASYNC_HANDLER;
|
||||
CryptoDCSettings c{};
|
||||
self->tun_start(opt, transcli, c); });
|
||||
}
|
||||
|
||||
private:
|
||||
Client(openvpn_io::io_context &io_context_arg,
|
||||
ClientConfig *config_arg,
|
||||
|
Loading…
Reference in New Issue
Block a user