[PATCH] propagate scan failures over d-bus

Mukesh Agrawal quiche
Wed Apr 9 13:27:22 PDT 2014


Thanks, Dan. I'll update my patch.


On Tue, Apr 8, 2014 at 9:19 PM, Dan Williams <dcbw at redhat.com> wrote:

> On Tue, 2014-04-08 at 17:59 -0700, quiche at chromium.org wrote:
> > If we receive a scan request via D-Bus, and wpa_supplicant_scan_trigger
> > fails, return the failure to the caller over D-Bus.
>
> I would suggest making a new namespaced error for the scan failure,
> which is API, instead of using a magic error string in the message.
> This makes it easier for clients to depend on the error.
>
> Copy and paste wpas_dbus_error_unknown_error(), rename it, and #define a
> new WPAS_DBUS_ERROR_UNKNOWN_ERROR called perhaps
> WPA_DBUS_ERROR_IFACE_SCAN_ERROR and defined to:
>
> WPAS_DBUS_NEW_IFACE_INTERFACE ".ScanError"
>
> since it's an interface (eg, network interface) specific error.
>
> The error string passed to dbus_message_new_error() is simply
> informational, and isn't supposed to be API in any way.
>
> Dan
>
> > Signed-hostap: mukesh agrawal <quiche at chromium.org>
> > ---
> >  wpa_supplicant/dbus/dbus_new_handlers.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c
> b/wpa_supplicant/dbus/dbus_new_handlers.c
> > index 4d5e109..d4f9a77 100644
> > --- a/wpa_supplicant/dbus/dbus_new_handlers.c
> > +++ b/wpa_supplicant/dbus/dbus_new_handlers.c
> > @@ -1221,7 +1221,10 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage
> *message,
> >                               "passive scan");
> >                       goto out;
> >               } else if (params.freqs && params.freqs[0]) {
> > -                     wpa_supplicant_trigger_scan(wpa_s, &params);
> > +                     if (wpa_supplicant_trigger_scan(wpa_s, &params)) {
> > +                             reply = wpas_dbus_error_unknown_error(
> > +                             message, "Scan request rejected");
> > +                     }
> >               } else {
> >                       wpa_s->scan_req = 2;
> >                       wpa_supplicant_req_scan(wpa_s, 0, 0);
> > @@ -1231,7 +1234,10 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage
> *message,
> >                       /* Add wildcard ssid */
> >                       params.num_ssids++;
> >               }
> > -             wpa_supplicant_trigger_scan(wpa_s, &params);
> > +             if (wpa_supplicant_trigger_scan(wpa_s, &params)) {
> > +                     reply = wpas_dbus_error_unknown_error(
> > +                             message, "Scan request rejected");
> > +             }
> >       } else {
> >               wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
> >                          "Unknown scan type: %s", type);
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20140409/5672f7da/attachment.htm>



More information about the Hostap mailing list