Skip to content

Commit

Permalink
Merge branch 'jb54607' into 'master'
Browse files Browse the repository at this point in the history
Fix BlockIPv6 internal option use

See merge request mer-core/connman!316
  • Loading branch information
LaakkonenJussi committed Jun 14, 2021
2 parents 5b4ae24 + a7b72e6 commit e3a2a62
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions connman/vpn/plugins/vpnc.c
Expand Up @@ -65,7 +65,7 @@ enum {

struct {
const char *cm_opt;
const char *vpnc_opt;
const char *vpnc_opt; /* Set this NULL for internal options */
const char *vpnc_default;
int type;
bool cm_save;
Expand All @@ -91,7 +91,7 @@ struct {
{ "VPNC.SingleDES", "Enable Single DES", NULL, OPT_BOOLEAN, true },
{ "VPNC.NoEncryption", "Enable no encryption", NULL, OPT_BOOLEAN,
true },
{ "VPNC.BlockIPv6", "BlockIPv6", NULL, OPT_BOOLEAN, true},
{ "VPNC.BlockIPv6", NULL, NULL, OPT_BOOLEAN, true},
};

struct vc_private_data {
Expand Down Expand Up @@ -319,6 +319,10 @@ static int vc_write_config_data(struct vpn_provider *provider, int fd)
int i;

for (i = 0; i < (int)ARRAY_SIZE(vpnc_options); i++) {
/* Ignore all internal options. */
if (!vpnc_options[i].vpnc_opt)
continue;

opt_s = vpn_provider_get_string(provider,
vpnc_options[i].cm_opt);
if (!opt_s)
Expand All @@ -327,12 +331,6 @@ static int vc_write_config_data(struct vpn_provider *provider, int fd)
if (!opt_s)
continue;

if (g_strcmp0(opt_s, "VPNC.BlockIPv6") && !g_ascii_strcasecmp(
vpnc_options[i].vpnc_opt, "true")) {
block_ipv6 = true;
continue;
}

if (vpnc_options[i].type == OPT_STRING) {
if (write_option(fd,
vpnc_options[i].vpnc_opt, opt_s) < 0)
Expand All @@ -345,6 +343,8 @@ static int vc_write_config_data(struct vpn_provider *provider, int fd)

}

block_ipv6 = vpn_provider_get_boolean(provider, "VPNC.BlockIPv6",
false);
vpn_provider_set_supported_ip_networks(provider, true, !block_ipv6);

return 0;
Expand Down

0 comments on commit e3a2a62

Please sign in to comment.