Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
service: Toggle VPN transport IPv6 when split routing changes
[service] Toggle VPN transport IPv6 when split routing changes. JB#48769

Enable/disable IPv6 on VPNs transport when the split routing value is
changed. This is important in both cases when a connected IPv4 VPN has
the value changed as with split routing -> non-split routing IPv6 should
be disabled as well as non-split-routing -> split routed IPv6 should be
re-enabled.
  • Loading branch information
LaakkonenJussi committed Mar 17, 2021
1 parent d68291d commit 7a2c437
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions connman/src/service.c
Expand Up @@ -745,16 +745,36 @@ void __connman_service_split_routing_changed(struct connman_service *service)
void __connman_service_set_split_routing(struct connman_service *service,
bool value)
{
bool change;

if (service->type != CONNMAN_SERVICE_TYPE_VPN)
return;

DBG("%p/%s value %s", service, service->identifier,
value ? "true" : "false");

change = service->do_split_routing != value;

service->do_split_routing = value;

if (service->do_split_routing)
service->order = 0;
else
service->order = 10;

/*
* Change IPv6 on the VPN transport when split routing value changes
* on a connected IPv4 VPN.
*/
if (connman_provider_get_family(service->provider) == AF_INET &&
change && is_connected(service)) {
if (__connman_provider_toggle_transport_ipv6(service->provider,
!value))
DBG("cannot toggle IPv6 on transport of service %p"
"provider %p", service,
service->provider);
}

/*
* In order to make sure the value is propagated also when loading the
* VPN service signal the value regardless of the value change.
Expand Down

0 comments on commit 7a2c437

Please sign in to comment.