Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'jb54605' into 'master'
Browse files Browse the repository at this point in the history
Fix PPPD noipv6 option use in pptp and l2tp

See merge request mer-core/connman!315
  • Loading branch information
LaakkonenJussi committed Jun 11, 2021
2 parents 53673f2 + ca5f60e commit 5b4ae24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions connman/vpn/plugins/l2tp.c
Expand Up @@ -387,7 +387,7 @@ static int write_pppd_option(struct vpn_provider *provider, int fd)
{
int i;
const char *opt_s;
bool no_ipv6 = false;
bool no_ipv6;

l2tp_write_option(fd, "nodetach", NULL);
l2tp_write_option(fd, "lock", NULL);
Expand All @@ -411,12 +411,6 @@ static int write_pppd_option(struct vpn_provider *provider, int fd)
if (!opt_s)
continue;

if (!g_strcmp0(opt_s, "PPPD.NoIPv6")) {
no_ipv6 = vpn_provider_get_boolean(provider,
pppd_options[i].cm_opt, false);
continue;
}

if (pppd_options[i].type == OPT_STRING)
l2tp_write_option(fd,
pppd_options[i].pppd_opt, opt_s);
Expand All @@ -432,6 +426,7 @@ static int write_pppd_option(struct vpn_provider *provider, int fd)
l2tp_write_option(fd, "plugin",
SCRIPTDIR "/libppp-plugin.so");

no_ipv6 = vpn_provider_get_boolean(provider, "PPPD.NoIPv6", false);
vpn_provider_set_supported_ip_networks(provider, true, !no_ipv6);

return 0;
Expand Down
9 changes: 2 additions & 7 deletions connman/vpn/plugins/pptp.c
Expand Up @@ -447,7 +447,7 @@ static int run_connect(struct vpn_provider *provider,
const char *opt_s;
const char *host;
char *str;
bool no_ipv6 = false;
bool no_ipv6;
int err, i;

if (!username || !password) {
Expand Down Expand Up @@ -484,12 +484,6 @@ static int run_connect(struct vpn_provider *provider,
if (!opt_s)
continue;

if (!g_strcmp0(opt_s, "PPPD.NoIPv6")) {
no_ipv6 = vpn_provider_get_boolean(provider,
pptp_options[i].cm_opt, false);
continue;
}

if (pptp_options[i].type == OPT_STRING)
connman_task_add_argument(task,
pptp_options[i].pptp_opt, opt_s);
Expand All @@ -508,6 +502,7 @@ static int run_connect(struct vpn_provider *provider,
connman_task_add_argument(task, "plugin",
SCRIPTDIR "/libppp-plugin.so");

no_ipv6 = vpn_provider_get_boolean(provider, "PPPD.NoIPv6", false);
vpn_provider_set_supported_ip_networks(provider, true, !no_ipv6);

err = connman_task_run(task, vpn_died, provider,
Expand Down

0 comments on commit 5b4ae24

Please sign in to comment.