In fact, if you look at the extraction of the EapMethods, it is required to handle an
array of strings (The same procedure required to extract the Interface's object
paths). In EapMethods extraction, the function supplicant_dbus_array_foreach goes across
the array and funcion eap_method() just gets the actual value. That's exactly what
interface_added() should do if it's called from service_property. Clearly, after that,
it is required to perform the GetAll over the just gotten Interface.
Regarding the question, yes, the idea would be to use GUINT_TO_POINTER/GPOINTER_TO_UINT
functions to get a value to distinguish the caller and then perform the correct action. I
will send the path.
From: Patrik Flykt [mailto:Patrik.Flykt@linux.intel.com]
Sent: Tuesday, July 12, 2016 3:17 PM
To: Blanquicet-Melendez Jose (MM); connman(a)lists.01.org
Subject: Re: Skipping wpa_supplicant interfaces by mistake
On Thu, 2016-07-07 at 12:13 +0000, Blanquicet-Melendez Jose (MM) wrote:
> If the wpa_supplicant has been launched before ConnMan, when the
> Connman calls the GetAll method on the fi.w1.wpa_supplicant1, the
> properties are returned as an array where there is an entry named
> "Interfaces". This entry is an array itself with only the object path
> of the current available interfaces. The problem occurs when ConnMan
> goes across this array using the function interface_added(), because
> this function tries also to extract the interface properties next to
> object path which is wrong because properties are not appended in this
> message reply. So, by doing dbus_message_iter_next(iter), we are
> actually skipping one interface of the list and it will result in a
> future error because the skipped interface(s) were not stored and
> ConnMan will not be aware of them.
> This issue is due to the function interface_added() is also used when
> signal "fi.w1.wpa_supplicant1.InterfaceAdded" arrives, and in this
> message the properties are actually appended. It could be solved by
> distinguishing the caller of the function interface_added(). It means
> to know if function interface_added() was called after a GetAll call
> or a InterfaceAdded signal in order to avoid trying to extract
> properties if they are not actually appended in the message.
> I think it could be done by taking advantage from the unused user_data
> argument of function interface_added(). Do you agree or is there
> something we are missing?
Looks like that after looking at it quickly. Maybe use a bool and wrap it with
with GUINT_TO_POINTER or such?
VISITA IL NOSTRO NUOVO SITO WEB! - VISIT OUR NEW WEB SITE! www.magnetimarelli.com
Confidential Notice: This message - including its attachments - may contain proprietary,
confidential and/or legally protected information and is intended solely for the use of
the designated addressee(s) above. If you are not the intended recipient be aware that any
downloading, copying, disclosure, distribution or use of the contents of the above
information is strictly prohibited.
If you have received this communication by mistake, please forward the message back to the
sender at the email address above, delete the message from all mailboxes and any other
electronic storage medium and destroy all copies.
Disclaimer Notice: Internet communications cannot be guaranteed to be safe or error-free.
Therefore we do not assure that this message is complete or accurate and we do not accept
liability for any errors or omissions in the contents of this message.