Fix param_bridge.c build errors: move g_ax_handle declaration before watchdog_cb, add missing TRUE arg to ax_parameter_set

This commit is contained in:
Weston Blieden
2026-04-17 18:31:19 +02:00
parent 3cc3cd4804
commit 256aaa9d23
4 changed files with 8 additions and 12 deletions
+2 -3
View File
@@ -35,6 +35,7 @@
#define CONFIG_FILE "/usr/local/packages/Tailscale_VPN/localdata/params.conf"
#define RUN_SCRIPT "/usr/local/packages/Tailscale_VPN/Tailscale_VPN_run"
static AXParameter *g_ax_handle = NULL;
static pid_t child_pid = -1;
static guint reload_timer_id = 0;
@@ -102,7 +103,7 @@ static gboolean watchdog_cb(gpointer G_GNUC_UNUSED data) {
/* If child exited 0, auth succeeded — clear AuthKey via axparameter */
if (exit_code == 0 && g_ax_handle && cfg_auth_key && *cfg_auth_key) {
GError *err = NULL;
if (ax_parameter_set(g_ax_handle, "AuthKey", "", &err)) {
if (ax_parameter_set(g_ax_handle, "AuthKey", "", TRUE, &err)) {
free(cfg_auth_key); cfg_auth_key = strdup("");
syslog(LOG_INFO, "AuthKey cleared after successful auth");
} else {
@@ -162,8 +163,6 @@ static void write_config_file(void) {
/* ── ACAP parameter callback ─────────────────────────────────────────────── */
static AXParameter *g_ax_handle = NULL;
static gboolean debounced_restart(gpointer G_GNUC_UNUSED data) {
reload_timer_id = 0;
if (g_ax_handle)
+2 -3
View File
@@ -25,6 +25,7 @@
#define CONFIG_FILE "/usr/local/packages/Tailscale_VPN/localdata/params.conf"
#define RUN_SCRIPT "/usr/local/packages/Tailscale_VPN/Tailscale_VPN_run"
static AXParameter *g_ax_handle = NULL;
static pid_t child_pid = -1;
static guint reload_timer_id = 0;
@@ -86,7 +87,7 @@ static gboolean watchdog_cb(gpointer G_GNUC_UNUSED data) {
/* If child exited 0, auth succeeded — clear AuthKey via axparameter */
if (exit_code == 0 && g_ax_handle && cfg_auth_key && *cfg_auth_key) {
GError *err = NULL;
if (ax_parameter_set(g_ax_handle, "AuthKey", "", &err)) {
if (ax_parameter_set(g_ax_handle, "AuthKey", "", TRUE, &err)) {
free(cfg_auth_key); cfg_auth_key = strdup("");
syslog(LOG_INFO, "AuthKey cleared after successful auth");
} else {
@@ -136,8 +137,6 @@ static void write_config_file(void) {
cache_get(&cfg_custom_server, "(default)"));
}
static AXParameter *g_ax_handle = NULL;
static gboolean debounced_restart(gpointer G_GNUC_UNUSED data) {
reload_timer_id = 0;
if (g_ax_handle)
+2 -3
View File
@@ -37,6 +37,7 @@
static pid_t child_pid = -1;
static guint reload_timer_id = 0;
static AXParameter *g_ax_handle = NULL;
static char *cfg_custom_server = NULL;
static char *cfg_auth_key = NULL;
@@ -102,7 +103,7 @@ static gboolean watchdog_cb(gpointer G_GNUC_UNUSED data) {
/* If child exited 0, auth succeeded — clear AuthKey via axparameter */
if (exit_code == 0 && g_ax_handle && cfg_auth_key && *cfg_auth_key) {
GError *err = NULL;
if (ax_parameter_set(g_ax_handle, "AuthKey", "", &err)) {
if (ax_parameter_set(g_ax_handle, "AuthKey", "", TRUE, &err)) {
free(cfg_auth_key); cfg_auth_key = strdup("");
syslog(LOG_INFO, "AuthKey cleared after successful auth");
} else {
@@ -162,8 +163,6 @@ static void write_config_file(void) {
/* ── ACAP parameter callback ─────────────────────────────────────────────── */
static AXParameter *g_ax_handle = NULL;
static gboolean debounced_restart(gpointer G_GNUC_UNUSED data) {
reload_timer_id = 0;
if (g_ax_handle)
+2 -3
View File
@@ -27,6 +27,7 @@
static pid_t child_pid = -1;
static guint reload_timer_id = 0;
static AXParameter *g_ax_handle = NULL;
static char *cfg_custom_server = NULL;
static char *cfg_auth_key = NULL;
@@ -86,7 +87,7 @@ static gboolean watchdog_cb(gpointer G_GNUC_UNUSED data) {
/* If child exited 0, auth succeeded — clear AuthKey via axparameter */
if (exit_code == 0 && g_ax_handle && cfg_auth_key && *cfg_auth_key) {
GError *err = NULL;
if (ax_parameter_set(g_ax_handle, "AuthKey", "", &err)) {
if (ax_parameter_set(g_ax_handle, "AuthKey", "", TRUE, &err)) {
free(cfg_auth_key); cfg_auth_key = strdup("");
syslog(LOG_INFO, "AuthKey cleared after successful auth");
} else {
@@ -136,8 +137,6 @@ static void write_config_file(void) {
cache_get(&cfg_custom_server, "(default)"));
}
static AXParameter *g_ax_handle = NULL;
static gboolean debounced_restart(gpointer G_GNUC_UNUSED data) {
reload_timer_id = 0;
if (g_ax_handle)