diff mbox series

ctrl_iface: fix newline in print_ml()

Message ID 20231222100609.163347-1-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series ctrl_iface: fix newline in print_ml() | expand

Commit Message

Andrei Otcheretianski Dec. 22, 2023, 10:06 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

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

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 wpa_supplicant/ctrl_iface.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Dec. 22, 2023, 3:42 p.m. UTC | #1
On Fri, Dec 22, 2023 at 12:06:09PM +0200, Andrei Otcheretianski wrote:
> We only print the newline if the AP MLD ID is present
> (BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID), fix that.

Thanks, applied.
diff mbox series

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index d05c9b8450..eedb1d6be4 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -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;
 }