On Wed, Sep 30, 2020 at 10:56:44AM +0300, Sergey Matyukevich wrote:
Suggested commit fixes runtime updates for WiFi service. For
consider the following use-case:
- cellular and WiFi technologies are enabled
- WiFi is a preferred technology
- EnableOnlineCheck is enabled
- WiFi service is described by a service file
- WiFi service is in ONLINE state
When access point is modified in WiFi service file, connman detects
those changes and performs WiFi service reconfiguration. However
updated WiFi service never reaches ONLINE state.
The root cause is in a stalled gateway value returned by
__connman_ipconfig_get_gateway_from_index in wispr_route_request
function. Online check fails since previous gateway address is used
for the new access point.
Looking at ipconfig code, it turns out that ipdevice->ipv_gateway
fields are not cleaned up when IPv system network configuration
is cleared. Suggested fix is to cleanup ipdevice IPv4/IPv6 gateways
whenever IPv4/IPv6 system network configuration is cleared.
Patch applied. I trimmed the commit message slightly. Hope that is okay.