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.
{
DBG("type %d", type);
+ if (g_atomic_int_get(®istered[type]) == 0) {
+ connman_error("notifier unregister underflow");
+ return;
+ }
+
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM:
{
DBG("type %d", type);
+ if (g_atomic_int_get(&enabled[type]) == 0) {
+ connman_error("notifier disable underflow");
+ return;
+ }
+
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM:
{
DBG("type %d", type);
+ if (g_atomic_int_get(&connected[type]) == 0) {
+ connman_error("notifier disconnect underflow");
+ return;
+ }
+
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM: