diff --git a/repos/ports/src/app/openvpn/main.cc b/repos/ports/src/app/openvpn/main.cc index 5c17880958..d6f0501135 100644 --- a/repos/ports/src/app/openvpn/main.cc +++ b/repos/ports/src/app/openvpn/main.cc @@ -13,9 +13,8 @@ /* Genode includes */ #include -#include +#include #include -#include #include #include #include @@ -39,7 +38,7 @@ extern int genode_argc; extern "C" int openvpn_main(int, char*[]); -class Openvpn_thread : public Genode::Thread_deprecated<16UL * 1024 * sizeof (long)> +class Openvpn_thread : public Genode::Thread { private: @@ -49,9 +48,9 @@ class Openvpn_thread : public Genode::Thread_deprecated<16UL * 1024 * sizeof (lo public: - Openvpn_thread(int argc, char *argv[]) + Openvpn_thread(Genode::Env &env, int argc, char *argv[]) : - Thread_deprecated("openvpn_main"), + Thread(env, "openvpn_main", 16UL * 1024 * sizeof (long)), _argc(argc), _argv(argv), _exitcode(-1) { } @@ -203,7 +202,8 @@ class Root : public Genode::Root_componentheap(), - *env()->ram_session(), - _ep); + _heap, + _env.ram(), + _env.ep()); /** * Setting the pointer in this manner is quite hackish but it has * to be valid before OpenVPN calls open_tun(), which unfortunatly @@ -245,7 +245,7 @@ class Root : public Genode::Root_componentheap()) Openvpn_thread(genode_argc, genode_argv); + _thread = new (_heap) Openvpn_thread(_env, genode_argc, genode_argv); _thread->start(); /* wait until OpenVPN configured the TUN/TAP device for the first time */ @@ -263,30 +263,19 @@ class Root : public Genode::Root_component(&ep.rpc_ep(), &md_alloc), - _ep(ep) + Root(Libc::Env &env) + : Genode::Root_component(env.ep(), _heap), + _env(env) { } }; -struct Main -{ - Genode::Entrypoint &ep; - ::Root nic_root { ep, *Genode::env()->heap() }; - - Main(Genode::Entrypoint &ep) : ep(ep) - { - Genode::env()->parent()->announce(ep.manage(nic_root)); - } -}; - - /*************** ** Component ** ***************/ void Libc::Component::construct(Libc::Env &env) { - static Main server(env.ep()); + static ::Root nic_root(env); + env.parent().announce(env.ep().manage(nic_root)); } diff --git a/repos/ports/src/app/openvpn/target.mk b/repos/ports/src/app/openvpn/target.mk index b38cc8b7b5..46d162ae6f 100644 --- a/repos/ports/src/app/openvpn/target.mk +++ b/repos/ports/src/app/openvpn/target.mk @@ -1,7 +1,7 @@ TARGET = openvpn LIBS += libc libc_pipe libc_lwip_nic_dhcp \ - libcrypto libssl config_args + libcrypto libssl OPENVPN_PORT_DIR := $(call select_from_ports,openvpn) OPENVPN_DIR := $(OPENVPN_PORT_DIR)/src/app/openvpn