Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pptp: Control IPv6 data leak prevention option with PPPD noipv6
[pptp] Control IPv6 data leak prevention option with PPPD noipv6. JB#53542

Add the PPPD supported noipv6 option to supported pptp options.

Control the IPv6 data leak prevention feature with PPPD option noipv6.
Require this value to be explicitly set in order to use the feature.
  • Loading branch information
LaakkonenJussi committed Apr 27, 2021
1 parent 77b2b10 commit dca4f68
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connman/vpn/plugins/pptp.c
Expand Up @@ -83,6 +83,7 @@ struct {
{ "PPPD.ReqMPPE128", "require-mppe-128", NULL, OPT_BOOL },
{ "PPPD.ReqMPPEStateful", "mppe-stateful", NULL, OPT_BOOL },
{ "PPPD.NoVJ", "novj", NULL, OPT_BOOL },
{ "PPPD.NoIPv6", "noipv6", NULL, OPT_BOOL},
};

static DBusConnection *connection;
Expand Down Expand Up @@ -446,6 +447,7 @@ static int run_connect(struct vpn_provider *provider,
const char *opt_s;
const char *host;
char *str;
bool no_ipv6 = false;
int err, i;

if (!username || !password) {
Expand Down Expand Up @@ -482,6 +484,12 @@ 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 @@ -500,6 +508,8 @@ static int run_connect(struct vpn_provider *provider,
connman_task_add_argument(task, "plugin",
SCRIPTDIR "/libppp-plugin.so");

vpn_provider_set_supported_ip_networks(provider, true, !no_ipv6);

err = connman_task_run(task, vpn_died, provider,
NULL, NULL, NULL);
if (err < 0) {
Expand Down

0 comments on commit dca4f68

Please sign in to comment.