On Sun, Oct 07, 2018 at 02:31:51PM +0200, Andrej Shadura wrote: > Make it possible to list connected stations in AP mode over D-Bus, along > with some of their properties: rx/tx packets, bytes, capabilities, etc. > > Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@xxxxxxxxxxxxx> > > Rebased by Julian Andres Klode <juliank@xxxxxxxxxx> and updated to use > the new getter API. > > Further modified by Andrej Shadura to not error out when not in AP mode > and to send separate StationAdded/StationRemoved signals instead of > changing signatures of existing StaAuthorized/StaDeauthorized signals. > > Signed-off-by: Andrej Shadura <andrew.shadura@xxxxxxxxxxxxxxx> Thanks, applied with fixes and cleanup. I just wonder how this was tested since this trigger a segmentation fault on first station connection and even with that fixed, the signals were swapped (StationRemove indicated when the station was added).. I removed indication of sta->flags since those WLAN_STA_* values are internal to hostapd implementation and subject to change without notice. In other words, they are not appropriate to expose over a D-Bus interface to external programs. If some of those flags are needed for external use, those specific flags should be exported separately and using values that are not implementation specific. > diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c > +static void wpas_dbus_signal_station(struct wpa_supplicant *wpa_s, > + const char *station_obj_path, > + const char *sig_name, dbus_bool_t properties) > + DBusMessageIter iter; > + if (msg == NULL) > + return; > + > + if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, > + &station_obj_path) || That's missing a call to dbus_message_iter_init_append(), i.e., segmentation fault here on using uninitialized stack values.. > +static const struct wpa_dbus_property_desc wpas_dbus_sta_properties[] = { > + { "Flags", WPAS_DBUS_NEW_IFACE_STA, "u", > + wpas_dbus_getter_sta_flags, > + NULL > + }, I dropped this since sta->flags bits are internal to the implementation and not guaranteed to remain same. > +int wpas_dbus_unregister_sta(struct wpa_supplicant *wpa_s, > + wpas_dbus_signal_station_added(wpa_s, station_obj_path); unregister --> added ?! > +int wpas_dbus_register_sta(struct wpa_supplicant *wpa_s, > + wpas_dbus_signal_station_removed(wpa_s, station_obj_path); register --> removed ?! -- Jouni Malinen PGP id EFC895FA _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap