Re: [PATCH] Fix the wrapping of dBus container for SignalPoll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch removes the wrapping of variants for SignalPoll, but I saw
this wrapping also used for all dict containers. Is this wrapping
expected?

Best regards
Kaidong

Best regards
Kaidong


On Wed, Jan 17, 2024 at 1:06 PM Kaidong Wang <kaidong@xxxxxxxxxxxx> wrote:
>
> SignalPoll is expected to return a dict, while the code wraps the dBus
> container as a variant, which leads to implicit unwrapping of variant.
>
> Wrap the dBus container as a dict for SignalPoll.
>
> Signed-off-by: Kaidong Wang <kaidong@xxxxxxxxxxxx>
> ---
>  wpa_supplicant/dbus/dbus_new_helpers.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/wpa_supplicant/dbus/dbus_new_helpers.c b/wpa_supplicant/dbus/dbus_new_helpers.c
> index 7fb066991..bac66b87b 100644
> --- a/wpa_supplicant/dbus/dbus_new_helpers.c
> +++ b/wpa_supplicant/dbus/dbus_new_helpers.c
> @@ -1046,7 +1046,7 @@ static double guard_interval_to_double(enum guard_interval value)
>  /**
>   * wpas_dbus_new_from_signal_information - Adds a wpa_signal_info
>   * to a DBusMessage.
> - * @msg: Pointer to message to append fields to
> + * @iter: Pointer to message to append fields to
>   * @si: Pointer to wpa_signal_info to add to the message
>   * Returns: 0 on success, otherwise, an errorcode
>   *
> @@ -1057,11 +1057,9 @@ static double guard_interval_to_double(enum guard_interval value)
>  int wpas_dbus_new_from_signal_information(DBusMessageIter *iter,
>                                           struct wpa_signal_info *si)
>  {
> -       DBusMessageIter iter_dict, variant_iter;
> +       DBusMessageIter iter_dict;
>
> -       if (!dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
> -                                             "a{sv}", &variant_iter) ||
> -           !wpa_dbus_dict_open_write(&variant_iter, &iter_dict) ||
> +       if (!wpa_dbus_dict_open_write(iter, &iter_dict) ||
>             !wpa_dbus_dict_append_int32(&iter_dict, "rssi",
>                                         si->data.signal) ||
>             !wpa_dbus_dict_append_uint32(&iter_dict, "linkspeed",
> @@ -1180,8 +1178,7 @@ int wpas_dbus_new_from_signal_information(DBusMessageIter *iter,
>             ((si->data.flags & STA_DRV_DATA_TX_HE_DCM) &&
>              !wpa_dbus_dict_append_bool(&iter_dict, "tx-dcm",
>                                         si->data.tx_dcm)) ||
> -           !wpa_dbus_dict_close_write(&variant_iter, &iter_dict) ||
> -           !dbus_message_iter_close_container(iter, &variant_iter))
> +               !wpa_dbus_dict_close_write(iter, &iter_dict))
>                 return -ENOMEM;
>
>         return 0;
> --
> 2.43.0.381.gb435a96ce8-goog
>

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux