Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[connman] Stop DHCP at user change, set WiFi to always change state . Fixes JB#60712 #43

Merged
merged 2 commits into from Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions connman/plugins/sailfish_wifi.c
Expand Up @@ -3458,14 +3458,17 @@ static void wifi_device_on_5(struct wifi_device *dev)

static void wifi_device_on_4(GSupplicantInterface *iface, void *data)
{
if (iface->valid) {
struct wifi_device *dev = data;
struct wifi_device *dev = data;

if (iface->valid) {
/* remove_handlers also zeros the event id */
gsupplicant_interface_remove_handlers(dev->iface,
dev->iface_event_id + DEVICE_INTERFACE_EVENT_VALID, 1);

wifi_device_on_5(dev);
} else {
DBG("failed to enable device, interface not valid");
wifi_device_set_state(dev, WIFI_DEVICE_UNDEFINED);
}
}

Expand Down
17 changes: 16 additions & 1 deletion connman/src/service.c
Expand Up @@ -9893,9 +9893,24 @@ void __connman_service_unload_services(gchar **services, int len)

switch (connman_service_get_type(service)) {
case CONNMAN_SERVICE_TYPE_WIFI:
if (service->network)
/*
* Stop all DHCPs before removing the service. This is
* to ensure that in cases where two users have the
* same network saved and DHCP is still pending for
* reply it is not left in that state. This may be
* possible in scenario where user change happens
* rapidly before the network is connected -> stopping
* of the DHCPs may not have been executed.
*/
if (service->ipconfig_ipv4)
__connman_dhcp_stop(service->ipconfig_ipv4);

if (service->network) {
__connman_dhcpv6_stop(service->network);
__connman_service_remove_from_network(
service->network);
}

break;
case CONNMAN_SERVICE_TYPE_VPN:
break;
Expand Down