technology: Do not presume a technology being hardblocked when created
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thu, 25 Oct 2012 07:54:57 +0000 (10:54 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 25 Oct 2012 13:18:30 +0000 (16:18 +0300)
This fixes an issue with the TechnologyAdded signal when the first
un-hardblock event occurs:
- when a technology was created, D-Bus registration was done and hardblock
  was set to TRUE even if there was no evidence that the technology was
  rfkill driven
- when the technology was updated to be rfkill driven, hardblock was already
  set to TRUE and thus the technology was not unregistered
- when an rfkill event un-hardblocks the technology, the TechnologyAdded
  signal was not sent since the technology was already registered to D-Bus

src/technology.c

index 290ec24..324a103 100644 (file)
@@ -920,7 +920,7 @@ static const GDBusSignalTable technology_signals[] = {
 static gboolean technology_dbus_register(struct connman_technology *technology)
 {
        if (technology->dbus_registered == TRUE ||
-                               (technology->rfkill_driven &&
+                               (technology->rfkill_driven == TRUE &&
                                 technology->hardblocked == TRUE))
                return TRUE;
 
@@ -982,11 +982,7 @@ static struct connman_technology *technology_get(enum connman_service_type type)
 
        technology->rfkill_driven = FALSE;
        technology->softblocked = FALSE;
-
-       if (type == CONNMAN_SERVICE_TYPE_ETHERNET)
-               technology->hardblocked = FALSE;
-       else
-               technology->hardblocked = TRUE;
+       technology->hardblocked = FALSE;
 
        technology->type = type;
        technology->path = g_strdup_printf("%s/technology/%s",