diff options
author | Grant Erickson <marathon96@gmail.com> | 2011-05-25 10:10:17 -0700 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-31 21:30:04 +0200 |
commit | b6480b70a2c9ededa0c49101d8a73f8bf45b3efa (patch) | |
tree | 03a01dbbf49fd848cc5e9544d45ae728981a03bf /src/connection.c | |
parent | 8025a0a6c612c803eb676e143989575cd3045e03 (diff) | |
download | connman-b6480b70a2c9ededa0c49101d8a73f8bf45b3efa.tar.gz connman-b6480b70a2c9ededa0c49101d8a73f8bf45b3efa.tar.bz2 connman-b6480b70a2c9ededa0c49101d8a73f8bf45b3efa.zip |
service: Indicate IP Configuration Ready Event
In the Connection Manager, completion of a valid IP configuration
excites the service state machine to move from the "configuration" to
the "ready" state.
However, the existing implementation of IP configuration completion
explicitly attempts to directly manipulate service state, rather than
hinting at an excitation event.
As a consequence, a late IP configuration completion after the service
state machine has transitioned from "ready" to "online" can lead to an
incorrect transition back to the "ready" state. This causes the
connection count for the technology associated with that service to
increment again, unnecessarily.
This patch avoids this issue by providing a service object interface
that simply hints that an IP configuration is complete for a given IP
type, allowing the service object and its state machine to either hold
fast in the present state, returning an advisory error or advancing,
as before.
All prior invocations of __connman_service_indicate_state outside of
the service module for the CONNMAN_SERVICE_STATE_READY are replaced
with calls to this new interface.
Thanks to Daniel Wagner and Marcel Holtmann for offline IRC discussion
that helped motivate this fix.
* v2: Incorporated feedback from Samuel Ortiz about combining IPv4
and IPv6 states before checking state readiness.
Diffstat (limited to 'src/connection.c')
-rw-r--r-- | src/connection.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/connection.c b/src/connection.c index 8ca1f7a0..10ef04a3 100644 --- a/src/connection.c +++ b/src/connection.c @@ -304,8 +304,7 @@ int __connman_connection_gateway_add(struct connman_service *service, __connman_service_nameserver_add_routes(service, new_gateway->ipv4_gateway); - __connman_service_indicate_state(service, CONNMAN_SERVICE_STATE_READY, - CONNMAN_IPCONFIG_TYPE_IPV4); + __connman_service_set_ipconfig_ready(service, CONNMAN_IPCONFIG_TYPE_IPV4); if (connman_service_get_type(service) == CONNMAN_SERVICE_TYPE_VPN) { new_gateway->vpn = TRUE; |