Skip to content

Commit

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

Add PPPD supported noipv6 option to supported L2TP 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 c549a57 commit 77b2b10
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connman/vpn/plugins/l2tp.c
Expand Up @@ -119,6 +119,7 @@ struct {
{ "PPPD.ReqMPPE128", "require-mppe-128", OPT_PPPD, NULL, OPT_BOOL },
{ "PPPD.ReqMPPEStateful", "mppe-stateful", OPT_PPPD, NULL, OPT_BOOL },
{ "PPPD.NoVJ", "novj", OPT_PPPD, NULL, OPT_BOOL },
{ "PPPD.NoIPv6", "noipv6", OPT_PPPD, NULL, OPT_BOOL},
};

static DBusConnection *connection;
Expand Down Expand Up @@ -386,6 +387,7 @@ static int write_pppd_option(struct vpn_provider *provider, int fd)
{
int i;
const char *opt_s;
bool no_ipv6 = false;

l2tp_write_option(fd, "nodetach", NULL);
l2tp_write_option(fd, "lock", NULL);
Expand All @@ -409,6 +411,12 @@ 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 @@ -424,6 +432,8 @@ static int write_pppd_option(struct vpn_provider *provider, int fd)
l2tp_write_option(fd, "plugin",
SCRIPTDIR "/libppp-plugin.so");

vpn_provider_set_supported_ip_networks(provider, true, !no_ipv6);

return 0;
}

Expand Down

0 comments on commit 77b2b10

Please sign in to comment.