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 Apr 22, 2024
1 parent 3072abd commit f9c70af
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 @@ -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])
Expand Down

0 comments on commit f9c70af

Please sign in to comment.