]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ctrl_iface: Fix newline in print_ml()
authorJohannes Berg <johannes.berg@intel.com>
Fri, 22 Dec 2023 10:06:09 +0000 (12:06 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 22 Dec 2023 15:14:33 +0000 (17:14 +0200)
We only print the newline if the AP MLD ID is present
(BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID), fix that.

Fixes: e3e68668c1f6 ("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>
wpa_supplicant/ctrl_iface.c

index 531f0c2ac3e5a3f41979b7d4ffa722e3ee41f13e..9c6050134e4556df212e28e55989f7237d9b0d98 100644 (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;
 }