[PATCH] dbus: add BSS changes notifications

Jouni Malinen j
Tue Jan 5 14:00:55 PST 2010

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) {
> +		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.

>  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.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list