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 62a1913 commit 90e6386
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,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])
Expand Down

0 comments on commit 90e6386

Please sign in to comment.