Re: [PATCH] add commands to hostapd_cli to dynamically change and clear vendor IE

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

 



On Fri, Jun 07, 2019 at 05:57:24AM +0200, Adrien Decostre wrote:
> The patch below adds 2 commands to hostapd_cli to dynamically change
> the vendor specific Information Element of the beacon without
> restarting the software access point.

That functionality is already available through SET and UPDATE_BEACON
control interface commands.

> diff --git a/hostapd/Makefile b/hostapd/Makefile
> @@ -1222,6 +1222,10 @@ OBJS += ../src/ap/acs.o
> +ifdef CONFIG_DYNAMIC_VENDOR_IE
> +CFLAGS += -DCONFIG_DYNAMIC_VENDOR_IE
> +endif

I don't think this functionality would justify adding more complexity in
form of a new build configuration parameter.

> diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c

> +static int hostapd_ctrl_iface_clear_vendor_ie(struct hostapd_data *hapd,
> +       const char *cmd)
> +{
> +    wpabuf_free(hapd->conf->vendor_elements);
> +    hapd->conf->vendor_elements = NULL;
> +    int ret = ieee802_11_set_beacon(hapd);
> +
> +    return ret;
> +}
> +
> +static int hostapd_ctrl_iface_add_vendor_ie(struct hostapd_data *hapd,
> +       const char *cmd)
> +{
> +    struct wpabuf *elems = wpabuf_parse_bin(cmd);
> +    if (!elems) {
> +        return -1;
> +    }
> +
> +    wpabuf_free(hapd->conf->vendor_elements);
> +    hapd->conf->vendor_elements = elems;
> +
> +    int ret = ieee802_11_set_beacon(hapd);
> +
> +    return ret;
> +}

These new commands CLEAR_VENDOR_IE and ADD_VENDOR_IE should not be
needed and should not be added since there is already existing mechanism
to update hapd->conf->* parameters (e.g., "SET vendor_elements <val>"
where empty value can be used to clear this). The only thing that could
be considered here would be automatic call to
ieee802_11_update_beacons() in the end of hostapd_ctrl_iface_set(), but
even that does not seem necessary when explicit UPDATE_BEACON command
can be used after having updated all the parameter values that are to be
updated.

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
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