Hi Daniel,

        GSupplicantInterface *interface;
        char *path;
        unsigned char device_address[6];
+       unsigned char iface_address[6];
I know it is too late but I would prefer a define ETH_ALEN from if_ether.h

Not too late no :)
I'll change device_address too.

+                       memcpy(data->iface_address, dev_addr, len);
+
+       } else if (g_strcmp0(key, "peer_object") == 0)
+               dbus_message_iter_get_basic(iter, &data->peer_obj_path);
+       else if (g_strcmp0(key, "interface_object") == 0)
+               dbus_message_iter_get_basic(iter, &data->interface_obj_path);
+       else if (g_strcmp0(key, "group_object") == 0)
+               dbus_message_iter_get_basic(iter, &data->group_obj_path);
+       else if (g_strcmp0(key, "role") == 0) {
+               const char *str = NULL;
+
+               dbus_message_iter_get_basic(iter, &str);
+               if (g_strcmp0(str, "GO") == 0)
+                       data->role = G_SUPPLICANT_GROUP_ROLE_GO;
+               else
+                       data->role = G_SUPPLICANT_GROUP_ROLE_CLIENT;
+       }

Please group the 'else if' with curly braces together if that is possible.

Sure, I'll move up the role part.

+}
+
+static void signal_group_failure(const char *path, DBusMessageIter *iter)
+{
+       GSupplicantInterface *interface;
+       struct group_sig_data data = {};
+       GSupplicantPeer *peer;
+
+       SUPPLICANT_DBG("");
+
+       interface = g_hash_table_lookup(interface_table, path);
+       if (!interface)
+               return;
+
+       supplicant_dbus_property_foreach(iter, group_sig_property, &data);
+       if (!data.peer_obj_path)
+               return;
+
+       peer = g_hash_table_lookup(interface->peer_table, data.peer_obj_path);
+       if (!peer)
+               return;
What do you want to do with peer?

Its usage comes in patch 8
Maybe I should move this part of the code here in patch 8 then.

+}
+
+static void signal_group_started(const char *path, DBusMessageIter *iter)
+{
+       GSupplicantInterface *interface;
+       struct group_sig_data data = {};
+       GSupplicantGroup *group;
+
+       SUPPLICANT_DBG("");
+
+       interface = g_hash_table_lookup(interface_table, path);
+       if (!interface)
+               return;
+
+       supplicant_dbus_property_foreach(iter, group_sig_property, &data);
+       if (!data.interface_obj_path || !data.group_obj_path)
+               return;
+
+       interface = g_hash_table_lookup(interface_table,
+                                               data.interface_obj_path);
+       if (!interface)
+               return;
+
+       group = g_hash_table_lookup(interface->group_table,
+                                               data.group_obj_path);
+       if (group)
+               return;
+
+       group = g_try_new0(GSupplicantGroup, 1);
+       if (!group)
+               return;
+
+       group->interface = interface;
+       group->path = g_strdup(data.group_obj_path);
+       group->role = data.role;
+
+       g_hash_table_insert(interface->group_table, group->path, group);
g_hash_table_replace?

No, we already verified above the group was not already there with a lookup.


Tomasz
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to