From 6ac43db0876ec814f1bcfad1ecf03b096738894f Mon Sep 17 00:00:00 2001 From: DarioM Date: Mon, 25 Sep 2023 10:45:45 +0200 Subject: [PATCH] Merge 'tun' config value if set in source configuration This commit modifies the `merge_config` function to include the 'tun' value from the source configuration if it is set. Previously, this value was not being merged, leading to inconsistencies in the final configuration. The change checks if 'tun' in the source configuration is different from its default value before merging it into the destination configuration. This ensures that the 'tun' setting is correctly propagated when configurations are merged, allowing for more flexible and accurate VPN setups. --- src/config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.c b/src/config.c index 6d3b9949..1a44ec34 100644 --- a/src/config.c +++ b/src/config.c @@ -533,6 +533,8 @@ void merge_config(struct vpn_config *dst, struct vpn_config *src) free(dst->pinentry); dst->pinentry = src->pinentry; } + if (src->tun != invalid_cfg.tun) + dst->tun = src->tun; if (src->realm[0]) strcpy(dst->realm, src->realm); if (src->iface_name[0])