Skip to content

Commit

Permalink
service: Enable ipconfig only for the changed IP type
Browse files Browse the repository at this point in the history
When IPv6.Configuration is changed to "off" then connman starts fresh
DHCP Requests for service after changing its state to Configuration.
In an ideal scenario IPv4 Configurations should not be affected on
changing IPv6.Configuration property.

This patch only enables ipconfig for the changed IP type and leaves
other IP type unchanged
  • Loading branch information
Saurav Babu authored and LaakkonenJussi committed Mar 17, 2021
1 parent 924bf7c commit 6b29293
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions connman/src/service.c
Expand Up @@ -4873,11 +4873,13 @@ static DBusMessage *set_property(DBusConnection *conn,
if (err < 0) {
if (is_connected_state(service, state) ||
is_connecting_state(service, state)) {
__connman_network_enable_ipconfig(
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
__connman_network_enable_ipconfig(
service->network,
service->ipconfig_ipv4,
false);
__connman_network_enable_ipconfig(
else
__connman_network_enable_ipconfig(
service->network,
service->ipconfig_ipv6,
false);
Expand All @@ -4892,10 +4894,14 @@ static DBusMessage *set_property(DBusConnection *conn,
ipv6_configuration_changed(service);

if (is_connecting(service) || is_connected(service)) {
__connman_network_enable_ipconfig(service->network,
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
__connman_network_enable_ipconfig(
service->network,
service->ipconfig_ipv4,
false);
__connman_network_enable_ipconfig(service->network,
else
__connman_network_enable_ipconfig(
service->network,
service->ipconfig_ipv6,
false);
}
Expand Down

0 comments on commit 6b29293

Please sign in to comment.