From 405d612e41ce8be128c3a9a9eb26880d2178c4ba 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 a95d16cc..b67809b9 100644 --- a/src/config.c +++ b/src/config.c @@ -539,6 +539,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])