Skip to content

Commit

Permalink
vpn: Add PreventIPv6DataLeak boolean to D-Bus properties
Browse files Browse the repository at this point in the history
[vpn] Add PreventIPv6DataLeak boolean to D-Bus properties. JB#53542

Add PreventIpv6DataLeak as a run-time changeable property emitted by
vpn-provider.c. This changes the behavior on whether to disable/block
the feature to disable IP family that is not used (currently only for
disabling IPv6) on the particular provider if the provider does not
have either of the IP families enabled.
  • Loading branch information
LaakkonenJussi committed Apr 27, 2021
1 parent ba77a79 commit 61a59dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions connman/plugins/vpn.c
Expand Up @@ -2042,6 +2042,7 @@ static gboolean property_changed(DBusConnection *conn,
const char *key;
const char *signature = DBUS_TYPE_STRING_AS_STRING
DBUS_TYPE_VARIANT_AS_STRING;
dbus_bool_t value_bool;

if (!dbus_message_has_signature(message, signature)) {
connman_error("vpn property signature \"%s\" does not match "
Expand Down Expand Up @@ -2113,13 +2114,16 @@ static gboolean property_changed(DBusConnection *conn,
data->domain = g_strdup(str);
connman_provider_set_domain(data->provider, data->domain);
} else if (g_str_equal(key, "SplitRouting")) {
dbus_bool_t split_routing;
dbus_message_iter_get_basic(&value, &split_routing);
change_provider_split_routing(data->provider, split_routing);
dbus_message_iter_get_basic(&value, &value_bool);
change_provider_split_routing(data->provider, value_bool);
} else if (g_str_equal(key, "DefaultRoute")) {
dbus_message_iter_get_basic(&value, &str);
change_provider_split_routing(data->provider,
!g_strcmp0(str, "false"));
} else if (g_str_equal(key, "PreventIPv6DataLeak")) {
dbus_message_iter_get_basic(&value, &value_bool);
connman_provider_set_ipv6_data_leak_prevention(data->provider,
value_bool);
}

if (ip_set && err == 0) {
Expand Down

0 comments on commit 61a59dc

Please sign in to comment.