Skip to content

Commit

Permalink
push-update: support for mac
Browse files Browse the repository at this point in the history
As with other platforms we just reopen tun
and apply resulting options.

OVPN3-1326

Signed-off-by: Lev Stipakov <lev@openvpn.net>
  • Loading branch information
lstipakov authored and Jenkins-dev committed Feb 14, 2025
1 parent ef873b9 commit 0b73995
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions openvpn/tun/mac/client/tuncli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,25 @@ class Client : public TunClient
stop_();
}

void apply_push_update(const OptionList &opt, TransportClient &cli) 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, &cli]
{
OPENVPN_ASYNC_HANDLER;
CryptoDCSettings c{};
self->tun_start(opt, cli, c);
});
}

private:
Client(openvpn_io::io_context &io_context_arg,
ClientConfig *config_arg,
Expand Down

0 comments on commit 0b73995

Please sign in to comment.