Compare commits

...
8 Commits
13 changed files with 219 additions and 156 deletions

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
BasedOnStyle: LLVM
IndentWidth: 8
TabWidth: 8
UseTab: Always
ColumnLimit: 80
BreakBeforeBraces: Linux
+4
View File
@@ -8,5 +8,9 @@ end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[{*.c,*.h}]
indent_style = tab
indent_size = 8
[{Makefile,Makefile.in}] [{Makefile,Makefile.in}]
indent_style = tab indent_style = tab
+1 -1
View File
@@ -31,7 +31,7 @@ jobs:
run: | run: |
# Set the matrix to include arm64 if the ref is a tag or is the dev branch # Set the matrix to include arm64 if the ref is a tag or is the dev branch
if [[ "${{ github.ref }}" == "refs/tags/"* || "${{ github.ref }}" == "refs/heads/dev" ]]; then if [[ "${{ github.ref }}" == "refs/tags/"* || "${{ github.ref }}" == "refs/heads/dev" ]]; then
echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}, {"runner": "arm64", "arch": "arm64"}]' >> $GITHUB_OUTPUT echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}, {"runner": "ubuntu-24.04-arm", "arch": "ubuntu-24.04-arm"}]' >> $GITHUB_OUTPUT
else else
echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}]' >> $GITHUB_OUTPUT echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}]' >> $GITHUB_OUTPUT
fi fi
+2 -2
View File
@@ -73,9 +73,9 @@ jobs:
const inputs = ${{ toJson(inputs) }} const inputs = ${{ toJson(inputs) }}
const { arch } = inputs const { arch } = inputs
const osMap = { const osMap = {
"all": ["ubuntu-latest", "arm64"], "all": ["ubuntu-latest", "ubuntu-24.04-arm"],
"x86_64": ["ubuntu-latest"], "x86_64": ["ubuntu-latest"],
"arm64": ["arm64"] "arm64": ["ubuntu-24.04-arm"]
} }
const package = Object.entries(inputs) const package = Object.entries(inputs)
Generated
+8 -8
View File
@@ -176,7 +176,7 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]] [[package]]
name = "auth" name = "auth"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"block2", "block2",
@@ -642,7 +642,7 @@ dependencies = [
[[package]] [[package]]
name = "common" name = "common"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"is_executable", "is_executable",
] ]
@@ -1625,7 +1625,7 @@ dependencies = [
[[package]] [[package]]
name = "gpapi" name = "gpapi"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.22.1", "base64 0.22.1",
@@ -1662,7 +1662,7 @@ dependencies = [
[[package]] [[package]]
name = "gpauth" name = "gpauth"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"auth", "auth",
@@ -1681,7 +1681,7 @@ dependencies = [
[[package]] [[package]]
name = "gpclient" name = "gpclient"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@@ -1703,7 +1703,7 @@ dependencies = [
[[package]] [[package]]
name = "gpgui-helper" name = "gpgui-helper"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@@ -1721,7 +1721,7 @@ dependencies = [
[[package]] [[package]]
name = "gpservice" name = "gpservice"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
@@ -2987,7 +2987,7 @@ dependencies = [
[[package]] [[package]]
name = "openconnect" name = "openconnect"
version = "2.4.4" version = "2.4.5"
dependencies = [ dependencies = [
"cc", "cc",
"common", "common",
+1 -1
View File
@@ -11,7 +11,7 @@ members = [
[workspace.package] [workspace.package]
rust-version = "1.80" rust-version = "1.80"
version = "2.4.4" version = "2.4.5"
authors = ["Kevin Yue <[email protected]>"] authors = ["Kevin Yue <[email protected]>"]
homepage = "https://github.com/yuezk/GlobalProtect-openconnect" homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
edition = "2021" edition = "2021"
+1 -1
View File
@@ -141,7 +141,7 @@ It is available via `guru` and `lamdness` overlays.
```bash ```bash
sudo eselect repository enable guru sudo eselect repository enable guru
sudo emerge -r guru sync sudo emerge -r guru sync
sudo emerge -av net-vpn/globalprotect-openconnect sudo emerge -av net-vpn/GlobalProtect-openconnect
``` ```
### Other distributions ### Other distributions
+8
View File
@@ -44,6 +44,9 @@ pub(crate) struct ConnectArgs {
#[arg(long, short, help = "The VPNC script to use")] #[arg(long, short, help = "The VPNC script to use")]
script: Option<String>, script: Option<String>,
#[arg(long, short, help = "The IFNAME for tunnel interface")]
interface: Option<String>,
#[arg(long, help = "Connect the server as a gateway, instead of a portal")] #[arg(long, help = "Connect the server as a gateway, instead of a portal")]
as_gateway: bool, as_gateway: bool,
@@ -93,6 +96,9 @@ pub(crate) struct ConnectArgs {
#[arg(long, help = "Disable DTLS and ESP")] #[arg(long, help = "Disable DTLS and ESP")]
no_dtls: bool, no_dtls: bool,
#[arg(long = "force-dpd", help = "Same as the '--force-dpd' option in the openconnect command")]
dpd_interval: Option<u32>,
#[cfg(feature = "webview-auth")] #[cfg(feature = "webview-auth")]
#[arg(long, help = "The HiDPI mode, useful for high-resolution screens")] #[arg(long, help = "The HiDPI mode, useful for high-resolution screens")]
hidpi: bool, hidpi: bool,
@@ -313,6 +319,7 @@ impl<'a> ConnectHandler<'a> {
let os = ClientOs::from(&self.args.os).to_openconnect_os().to_string(); let os = ClientOs::from(&self.args.os).to_openconnect_os().to_string();
let vpn = Vpn::builder(gateway, cookie) let vpn = Vpn::builder(gateway, cookie)
.script(self.args.script.clone()) .script(self.args.script.clone())
.interface(self.args.interface.clone())
.user_agent(self.args.user_agent.clone()) .user_agent(self.args.user_agent.clone())
.os(Some(os)) .os(Some(os))
.certificate(self.args.certificate.clone()) .certificate(self.args.certificate.clone())
@@ -324,6 +331,7 @@ impl<'a> ConnectHandler<'a> {
.mtu(mtu) .mtu(mtu)
.disable_ipv6(self.args.disable_ipv6) .disable_ipv6(self.args.disable_ipv6)
.no_dtls(self.args.no_dtls) .no_dtls(self.args.no_dtls)
.dpd_interval(self.args.dpd_interval.unwrap_or(0))
.build()?; .build()?;
let vpn = Arc::new(vpn); let vpn = Arc::new(vpn);
+6
View File
@@ -1,5 +1,11 @@
# Changelog # Changelog
## 2.4.5 - 2025-07-16
- GUI/CLI: fix the issue that the custom port is not supported issue (fix [#404](https://github.com/yuezk/GlobalProtect-openconnect/issues/404))
- CLI: add the `--force-dpd` option to specify the interval for DPD (Dead Peer Detection).
- CLI: add the `-i/--interface` option to specify the interface to use.
## 2.4.4 - 2025-02-09 ## 2.4.4 - 2025-02-09
- GUI: fix multiple tray icons issue (fix [#464](https://github.com/yuezk/GlobalProtect-openconnect/issues/464)) - GUI: fix multiple tray icons issue (fix [#464](https://github.com/yuezk/GlobalProtect-openconnect/issues/464))
+3
View File
@@ -12,6 +12,7 @@ pub(crate) struct ConnectOptions {
pub user_agent: *const c_char, pub user_agent: *const c_char,
pub script: *const c_char, pub script: *const c_char,
pub interface: *const c_char,
pub os: *const c_char, pub os: *const c_char,
pub certificate: *const c_char, pub certificate: *const c_char,
pub sslkey: *const c_char, pub sslkey: *const c_char,
@@ -25,6 +26,8 @@ pub(crate) struct ConnectOptions {
pub mtu: u32, pub mtu: u32,
pub disable_ipv6: u32, pub disable_ipv6: u32,
pub no_dtls: u32, pub no_dtls: u32,
pub dpd_interval: u32,
} }
#[link(name = "vpn")] #[link(name = "vpn")]
+114 -98
View File
@@ -1,9 +1,9 @@
#include <openconnect.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <openconnect.h> #include <unistd.h>
#include "vpn.h" #include "vpn.h"
@@ -11,143 +11,159 @@ void *g_user_data;
static int g_cmd_pipe_fd; static int g_cmd_pipe_fd;
static const char *g_vpnc_script; static const char *g_vpnc_script;
static const char *g_vpnc_interface;
static vpn_connected_callback on_vpn_connected; static vpn_connected_callback on_vpn_connected;
/* Validate the peer certificate */ /* Validate the peer certificate */
static int validate_peer_cert(__attribute__((unused)) void *_vpninfo, const char *reason) static int validate_peer_cert(__attribute__((unused)) void *_vpninfo,
const char *reason)
{ {
INFO("Accepting the server certificate though %s", reason); INFO("Accepting the server certificate though %s", reason);
return 0; return 0;
} }
/* Print progress messages */ /* Print progress messages */
static void print_progress(__attribute__((unused)) void *_vpninfo, int level, const char *format, ...) static void print_progress(__attribute__((unused)) void *_vpninfo, int level,
const char *format, ...)
{ {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
char *message = format_message(format, args); char *message = format_message(format, args);
va_end(args); va_end(args);
if (message == NULL) { if (message == NULL) {
ERROR("Failed to format log message"); ERROR("Failed to format log message");
} else { } else {
LOG(level, message); LOG(level, message);
free(message); free(message);
} }
} }
static void setup_tun_handler(void *_vpninfo) static void setup_tun_handler(void *_vpninfo)
{ {
int ret = openconnect_setup_tun_device(_vpninfo, g_vpnc_script, NULL); int ret = openconnect_setup_tun_device(_vpninfo, g_vpnc_script,
if (!ret) { g_vpnc_interface);
on_vpn_connected(g_cmd_pipe_fd, g_user_data); if (!ret) {
} on_vpn_connected(g_cmd_pipe_fd, g_user_data);
}
} }
/* Initialize VPN connection */ /* Initialize VPN connection */
int vpn_connect(const vpn_options *options, vpn_connected_callback callback) int vpn_connect(const vpn_options *options, vpn_connected_callback callback)
{ {
INFO("openconnect version: %s", openconnect_get_version()); INFO("openconnect version: %s", openconnect_get_version());
struct openconnect_info *vpninfo; struct openconnect_info *vpninfo;
struct utsname utsbuf; struct utsname utsbuf;
g_user_data = options->user_data; g_user_data = options->user_data;
g_vpnc_script = options->script; g_vpnc_script = options->script;
on_vpn_connected = callback; g_vpnc_interface = options->interface;
on_vpn_connected = callback;
INFO("User agent: %s", options->user_agent); INFO("User agent: %s", options->user_agent);
INFO("VPNC script: %s", options->script); INFO("VPNC script: %s", options->script);
INFO("OS: %s", options->os); INFO("OS: %s", options->os);
INFO("CSD_USER: %d", options->csd_uid); INFO("CSD_USER: %d", options->csd_uid);
INFO("CSD_WRAPPER: %s", options->csd_wrapper); INFO("CSD_WRAPPER: %s", options->csd_wrapper);
INFO("RECONNECT_TIMEOUT: %d", options->reconnect_timeout); INFO("RECONNECT_TIMEOUT: %d", options->reconnect_timeout);
INFO("MTU: %d", options->mtu); INFO("MTU: %d", options->mtu);
INFO("DISABLE_IPV6: %d", options->disable_ipv6); INFO("DISABLE_IPV6: %d", options->disable_ipv6);
INFO("NO_DTLS: %d", options->no_dtls); INFO("NO_DTLS: %d", options->no_dtls);
INFO("DPD_INTERVAL: %d", options->dpd_interval);
vpninfo = openconnect_vpninfo_new(options->user_agent, validate_peer_cert, NULL, NULL, print_progress, NULL); vpninfo =
openconnect_vpninfo_new(options->user_agent, validate_peer_cert,
NULL, NULL, print_progress, NULL);
if (!vpninfo) { if (!vpninfo) {
ERROR("openconnect_vpninfo_new failed"); ERROR("openconnect_vpninfo_new failed");
return 1; return 1;
} }
openconnect_set_loglevel(vpninfo, PRG_TRACE); openconnect_set_loglevel(vpninfo, PRG_TRACE);
openconnect_init_ssl(); openconnect_init_ssl();
openconnect_set_protocol(vpninfo, "gp"); openconnect_set_protocol(vpninfo, "gp");
openconnect_set_hostname(vpninfo, options->server); openconnect_parse_url(vpninfo, options->server);
openconnect_set_cookie(vpninfo, options->cookie); openconnect_set_cookie(vpninfo, options->cookie);
if (options->os) { if (options->os) {
openconnect_set_reported_os(vpninfo, options->os); openconnect_set_reported_os(vpninfo, options->os);
} }
if (options->certificate) { if (options->certificate) {
INFO("Setting client certificate: %s", options->certificate); INFO("Setting client certificate: %s", options->certificate);
openconnect_set_client_cert(vpninfo, options->certificate, options->sslkey); openconnect_set_client_cert(vpninfo, options->certificate,
} options->sslkey);
}
if (options->key_password) { if (options->key_password) {
openconnect_set_key_password(vpninfo, options->key_password); openconnect_set_key_password(vpninfo, options->key_password);
} }
if (options->csd_wrapper) { if (options->csd_wrapper) {
openconnect_setup_csd(vpninfo, options->csd_uid, 1, options->csd_wrapper); openconnect_setup_csd(vpninfo, options->csd_uid, 1,
} options->csd_wrapper);
}
if (options->mtu > 0) { if (options->mtu > 0) {
int mtu = options->mtu < 576 ? 576 : options->mtu; int mtu = options->mtu < 576 ? 576 : options->mtu;
openconnect_set_reqmtu(vpninfo, mtu); openconnect_set_reqmtu(vpninfo, mtu);
} }
if (options->disable_ipv6) { if (options->disable_ipv6) {
openconnect_disable_ipv6(vpninfo); openconnect_disable_ipv6(vpninfo);
} }
g_cmd_pipe_fd = openconnect_setup_cmd_pipe(vpninfo); if (options->dpd_interval > 0) {
if (g_cmd_pipe_fd < 0) { openconnect_set_dpd(vpninfo, options->dpd_interval);
ERROR("openconnect_setup_cmd_pipe failed"); }
return 1;
}
if (!uname(&utsbuf)) { g_cmd_pipe_fd = openconnect_setup_cmd_pipe(vpninfo);
openconnect_set_localname(vpninfo, utsbuf.nodename); if (g_cmd_pipe_fd < 0) {
} ERROR("openconnect_setup_cmd_pipe failed");
return 1;
}
// Essential step if (!uname(&utsbuf)) {
if (openconnect_make_cstp_connection(vpninfo) != 0) { openconnect_set_localname(vpninfo, utsbuf.nodename);
ERROR("openconnect_make_cstp_connection failed"); }
return 1;
}
if (options->no_dtls || openconnect_setup_dtls(vpninfo, 60) != 0) { // Essential step
openconnect_disable_dtls(vpninfo); if (openconnect_make_cstp_connection(vpninfo) != 0) {
} ERROR("openconnect_make_cstp_connection failed");
return 1;
}
// Essential step if (options->no_dtls || openconnect_setup_dtls(vpninfo, 60) != 0) {
openconnect_set_setup_tun_handler(vpninfo, setup_tun_handler); openconnect_disable_dtls(vpninfo);
}
while (1) { // Essential step
int ret = openconnect_mainloop(vpninfo, options->reconnect_timeout, 10); openconnect_set_setup_tun_handler(vpninfo, setup_tun_handler);
if (ret) { while (1) {
INFO("openconnect_mainloop returned %d, exiting", ret); int ret = openconnect_mainloop(vpninfo,
openconnect_vpninfo_free(vpninfo); options->reconnect_timeout, 10);
return ret;
}
INFO("openconnect_mainloop returned 0, reconnecting"); if (ret) {
} INFO("openconnect_mainloop returned %d, exiting", ret);
openconnect_vpninfo_free(vpninfo);
return ret;
}
INFO("openconnect_mainloop returned 0, reconnecting");
}
} }
/* Stop the VPN connection */ /* Stop the VPN connection */
void vpn_disconnect() void vpn_disconnect()
{ {
char cmd = OC_CMD_CANCEL; char cmd = OC_CMD_CANCEL;
INFO("Stopping VPN connection: %d", g_cmd_pipe_fd); INFO("Stopping VPN connection: %d", g_cmd_pipe_fd);
if (write(g_cmd_pipe_fd, &cmd, 1) < 0) { if (write(g_cmd_pipe_fd, &cmd, 1) < 0) {
ERROR("Failed to write to command pipe, VPN connection may not be stopped"); ERROR("Failed to write to command pipe, VPN connection may not "
} "be stopped");
}
} }
+43 -45
View File
@@ -1,31 +1,33 @@
#include <openconnect.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h>
#include <openconnect.h>
typedef void (*vpn_connected_callback)(int cmd_pipe_fd, void *user_data); typedef void (*vpn_connected_callback)(int cmd_pipe_fd, void *user_data);
typedef struct vpn_options typedef struct vpn_options {
{ void *user_data;
void *user_data; const char *server;
const char *server; const char *cookie;
const char *cookie; const char *user_agent;
const char *user_agent;
const char *script; const char *script;
const char *os; const char *interface;
const char *certificate; const char *os;
const char *sslkey; const char *certificate;
const char *key_password; const char *sslkey;
const char *servercert; const char *key_password;
const char *servercert;
const uid_t csd_uid; const uid_t csd_uid;
const char *csd_wrapper; const char *csd_wrapper;
const int reconnect_timeout; const int reconnect_timeout;
const int mtu; const int mtu;
const int disable_ipv6; const int disable_ipv6;
const int no_dtls; const int no_dtls;
const int dpd_interval;
} vpn_options; } vpn_options;
int vpn_connect(const vpn_options *options, vpn_connected_callback callback); int vpn_connect(const vpn_options *options, vpn_connected_callback callback);
@@ -35,40 +37,36 @@ extern void vpn_log(int level, const char *msg);
static char *format_message(const char *format, va_list args) static char *format_message(const char *format, va_list args)
{ {
va_list args_copy; va_list args_copy;
va_copy(args_copy, args); va_copy(args_copy, args);
int len = vsnprintf(NULL, 0, format, args_copy); int len = vsnprintf(NULL, 0, format, args_copy);
va_end(args_copy); va_end(args_copy);
char *buffer = (char*)malloc(len + 1); char *buffer = (char *)malloc(len + 1);
if (buffer == NULL) if (buffer == NULL) {
{ return NULL;
return NULL; }
}
vsnprintf(buffer, len + 1, format, args); vsnprintf(buffer, len + 1, format, args);
return buffer; return buffer;
} }
static void _log(int level, ...) static void _log(int level, ...)
{ {
va_list args; va_list args;
va_start(args, level); va_start(args, level);
char *format = va_arg(args, char *); char *format = va_arg(args, char *);
char *message = format_message(format, args); char *message = format_message(format, args);
va_end(args); va_end(args);
if (message == NULL) if (message == NULL) {
{ vpn_log(PRG_ERR, "Failed to format log message");
vpn_log(PRG_ERR, "Failed to format log message"); } else {
} vpn_log(level, message);
else free(message);
{ }
vpn_log(level, message);
free(message);
}
} }
#define LOG(level, ...) _log(level, __VA_ARGS__) #define LOG(level, ...) _log(level, __VA_ARGS__)
+22
View File
@@ -16,6 +16,7 @@ pub struct Vpn {
cookie: CString, cookie: CString,
user_agent: CString, user_agent: CString,
script: CString, script: CString,
interface: Option<CString>,
os: CString, os: CString,
certificate: Option<CString>, certificate: Option<CString>,
sslkey: Option<CString>, sslkey: Option<CString>,
@@ -30,6 +31,8 @@ pub struct Vpn {
disable_ipv6: bool, disable_ipv6: bool,
no_dtls: bool, no_dtls: bool,
dpd_interval: u32,
callback: OnConnectedCallback, callback: OnConnectedCallback,
} }
@@ -65,6 +68,7 @@ impl Vpn {
cookie: self.cookie.as_ptr(), cookie: self.cookie.as_ptr(),
user_agent: self.user_agent.as_ptr(), user_agent: self.user_agent.as_ptr(),
script: self.script.as_ptr(), script: self.script.as_ptr(),
interface: Self::option_to_ptr(&self.interface),
os: self.os.as_ptr(), os: self.os.as_ptr(),
certificate: Self::option_to_ptr(&self.certificate), certificate: Self::option_to_ptr(&self.certificate),
@@ -79,6 +83,7 @@ impl Vpn {
mtu: self.mtu, mtu: self.mtu,
disable_ipv6: self.disable_ipv6 as u32, disable_ipv6: self.disable_ipv6 as u32,
no_dtls: self.no_dtls as u32, no_dtls: self.no_dtls as u32,
dpd_interval: self.dpd_interval,
} }
} }
@@ -113,6 +118,7 @@ pub struct VpnBuilder {
server: String, server: String,
cookie: String, cookie: String,
script: Option<String>, script: Option<String>,
interface: Option<String>,
user_agent: Option<String>, user_agent: Option<String>,
os: Option<String>, os: Option<String>,
@@ -128,6 +134,8 @@ pub struct VpnBuilder {
mtu: u32, mtu: u32,
disable_ipv6: bool, disable_ipv6: bool,
no_dtls: bool, no_dtls: bool,
dpd_interval: u32,
} }
impl VpnBuilder { impl VpnBuilder {
@@ -136,6 +144,7 @@ impl VpnBuilder {
server: server.to_string(), server: server.to_string(),
cookie: cookie.to_string(), cookie: cookie.to_string(),
script: None, script: None,
interface: None,
user_agent: None, user_agent: None,
os: None, os: None,
@@ -151,6 +160,7 @@ impl VpnBuilder {
mtu: 0, mtu: 0,
disable_ipv6: false, disable_ipv6: false,
no_dtls: false, no_dtls: false,
dpd_interval: 0,
} }
} }
@@ -159,6 +169,11 @@ impl VpnBuilder {
self self
} }
pub fn interface<T: Into<Option<String>>>(mut self, interface: T) -> Self {
self.interface = interface.into();
self
}
pub fn user_agent<T: Into<Option<String>>>(mut self, user_agent: T) -> Self { pub fn user_agent<T: Into<Option<String>>>(mut self, user_agent: T) -> Self {
self.user_agent = user_agent.into(); self.user_agent = user_agent.into();
self self
@@ -214,6 +229,11 @@ impl VpnBuilder {
self self
} }
pub fn dpd_interval(mut self, dpd_interval: u32) -> Self {
self.dpd_interval = dpd_interval;
self
}
pub fn build(self) -> Result<Vpn, VpnError> { pub fn build(self) -> Result<Vpn, VpnError> {
let script = match self.script { let script = match self.script {
Some(script) => { Some(script) => {
@@ -235,6 +255,7 @@ impl VpnBuilder {
cookie: Self::to_cstring(&self.cookie), cookie: Self::to_cstring(&self.cookie),
user_agent: Self::to_cstring(&user_agent), user_agent: Self::to_cstring(&user_agent),
script: Self::to_cstring(&script), script: Self::to_cstring(&script),
interface: self.interface.as_deref().map(Self::to_cstring),
os: Self::to_cstring(&os), os: Self::to_cstring(&os),
certificate: self.certificate.as_deref().map(Self::to_cstring), certificate: self.certificate.as_deref().map(Self::to_cstring),
@@ -249,6 +270,7 @@ impl VpnBuilder {
mtu: self.mtu, mtu: self.mtu,
disable_ipv6: self.disable_ipv6, disable_ipv6: self.disable_ipv6,
no_dtls: self.no_dtls, no_dtls: self.no_dtls,
dpd_interval: self.dpd_interval,
callback: Default::default(), callback: Default::default(),
}) })