[PATCH] hostapd_cli: Introduce add_link command

Jouni Malinen j at w1.fi
Sat Apr 4 06:31:42 PDT 2026


On Thu, Mar 12, 2026 at 06:28:45PM +0100, Lorenzo Bianconi wrote:
> Introduce add_link command in order to re-add a previously link removed
> via hostapd_cli remove_link comand. The add_link command relies on the
> following syntax:

It's confusing to see hostapd_cli in the commit message title since this
is really about adding a new LINK_ADD control interface command. Why is
the hostapd_cli command called add_link when the hostapd control
interface command is LINK_ADD?

Why is this added within CONFIG_TESTING_OPTIONS? Is this only for
testing? If so, the commit message should say so. If not, this probably
should not be conditional on CONFIG_TESTING_OPTIONS.

What happens if this new command is used with a link that was not
previously remvoed using hostapd_cli remove_link?

It would be good to test compilation with more warnings enabled since
this has at least following issues:

ctrl_iface.c: In function ‘hostapd_ctrl_iface_link_add’:
ctrl_iface.c:3600:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
 3600 |         for (i = 0; i < interfaces->count; i++) {
      |                       ^
ctrl_iface.c:3611:39: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
 3611 |                         for (i = 0; i < iface->num_bss; i++) {
      |                                       ^
ctrl_iface.c:3642:16: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized]
 3642 |         return ret;
      |                ^~~
ctrl_iface.c:3570:16: note: ‘ret’ was declared here
 3570 |         int i, ret;
      |                ^~~
cc1: all warnings being treated as errors
make: *** [../src/build.rules:90: /home/jm/Git/hostap/build/hostapd/ctrl_iface.o] Error 1

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list