When network and service events occur from the bottom up
(e.g. supplicant, link state, etc.) that also incur IP configuration
changes, it is possible for one or more of the notifier counters to
underflow, leaving connman in a state from which it can never recover
without a process restart.
By limiting underflow of the three notifier counters, these non-
recoverable states are prevented.
---
src/notifier.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/notifier.c b/src/notifier.c
index 27e53a1..003b024 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -241,6 +241,9 @@ void __connman_notifier_unregister(enum
connman_service_type type)
{
DBG("type %d", type);
+ if (g_atomic_int_get(®istered[type]) == 0)
+ return;
+
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM:
@@ -287,6 +290,9 @@ void __connman_notifier_disable(enum connman_service_type
type)
{
DBG("type %d", type);
+ if (g_atomic_int_get(&enabled[type]) == 0)
+ return;
+
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM:
@@ -333,6 +339,9 @@ void __connman_notifier_disconnect(enum
connman_service_type type)
{
DBG("type %d", type);
+ if (g_atomic_int_get(&connected[type]) == 0)
+ return;
+
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM:
--
1.7.5
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman