ctrl_iface: Fix newline in print_ml()

We only print the newline if the AP MLD ID is present
(BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID), fix that.

Fixes: e3e68668c1 ("ctrl_iface: Report RNR and ML in BSS command")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Johannes Berg 2023-12-22 12:06:09 +02:00 committed by Jouni Malinen
parent a3a34c0eb1
commit 41e65efa3a

View file

@ -5252,7 +5252,7 @@ static int print_ml(struct wpa_bss *bss, char *pos, char *end)
if (common_info_length < 1)
return 0;
ret = os_snprintf(pos, end - pos, ", MLD ID=0x%x\n", *ie);
ret = os_snprintf(pos, end - pos, ", MLD ID=0x%x", *ie);
if (os_snprintf_error(end - pos, ret))
return 0;
pos += ret;
@ -5260,6 +5260,11 @@ static int print_ml(struct wpa_bss *bss, char *pos, char *end)
common_info_length--;
}
ret = os_snprintf(pos, end - pos, "\n");
if (os_snprintf_error(end - pos, ret))
return 0;
pos += ret;
return pos - start;
}