Skip to content

Commit

Permalink
Merge 'tun' config value if set in source configuration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DblD authored and DimitriPapadopoulos committed Sep 25, 2023
1 parent beefa44 commit 2e47e17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ 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])
Expand Down

0 comments on commit 2e47e17

Please sign in to comment.