[PATCH] dbus: add BSS changes notifications

Witold Sowa witold.sowa at gmail.com
Tue Jan 5 17:36:42 EST 2010


Jouni Malinen pisze:
> On Mon, Jan 04, 2010 at 08:41:57PM +0100, Witold Sowa wrote:
>> Send PropertiesChanged signal from BSS object with dict of properties
>> that has changed and theirs values if any changes occurred.
> 
>> +static int are_ies_equal(const struct wpa_bss *old,
>> +		       const struct wpa_scan_res *new,
>> +		       u32 ie)
> 
>> +	switch (ie) {
>> +	case WPA_IE_VENDOR_TYPE:
>> +	case WPS_IE_VENDOR_TYPE:
>> +		old_ie = wpa_bss_get_vendor_ie(old, WPA_IE_VENDOR_TYPE);
>> +		new_ie = wpa_scan_get_vendor_ie(new, WPA_IE_VENDOR_TYPE);
> 
> I would assume the second argument was supposed to be 'ie' here (and
> same for RSN), i.e., the switch is just selecting between vendor IE and
> non-vendor IE.
> 
Yes, of course. A copy-paste error. Shame on me. :-(

>>  static void wpa_bss_update(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
>>  			   struct wpa_scan_res *res)
>>  {
>> +	notify_bss_changes(wpa_s, bss, res);
> 
> This call happens before the BSS entry is updated. This sounds a bit
> racy, i.e., none of the notification handlers would be able to fetch the
> new data from the BSS entry when processing the notification. That may
> work with the current D-Bus code due to the aggregation of signals, but
> it would not work some other things that I would expect to be using the
> notify.c callbacks. In other words, this should most likely do the
> comparison first (and say, store a bitfield of changed values) and then
> call the notification functions only after having updated the BSS entry.
> 
Agreed. I didn't take under consideration the fact that DBus won't be
the only beneficent of notifications callbacks forever.

Do you want me to resend the patch corrected?

Witek.


More information about the HostAP mailing list