]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add VLANID in the AP-STA-CONNECTED events
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Tue, 26 Aug 2025 08:41:45 +0000 (11:41 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 26 Aug 2025 09:39:32 +0000 (12:39 +0300)
Indicate which VLAN was assigned, if any, in AP-STA-CONNECTED events.

Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
src/ap/sta_info.c

index 4ad809cb25ca28fcb34cc894c822797a34825611..91538ec410acc97b9961d96a856850519d8b17d4 100644 (file)
@@ -1598,10 +1598,13 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
                char dpp_pkhash_buf[100];
                char keyid_buf[100];
                char ip_addr[100];
+               char vlanid_buf[20];
 
                dpp_pkhash_buf[0] = '\0';
                keyid_buf[0] = '\0';
                ip_addr[0] = '\0';
+               vlanid_buf[0] = '\0';
+
 #ifdef CONFIG_P2P
                if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) {
                        os_snprintf(ip_addr, sizeof(ip_addr),
@@ -1630,15 +1633,21 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
                                         dpp_pkhash, SHA256_MAC_LEN);
                }
 
-               wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s",
-                       buf, ip_addr, keyid_buf, dpp_pkhash_buf);
+#ifndef CONFIG_NO_VLAN
+               if (sta->vlan_id)
+                       os_snprintf(vlanid_buf, sizeof(vlanid_buf),
+                                   " vlanid=%u", sta->vlan_id);
+#endif /* CONFIG_NO_VLAN */
+
+               wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s%s",
+                       buf, ip_addr, keyid_buf, dpp_pkhash_buf, vlanid_buf);
 
                if (hapd->msg_ctx_parent &&
                    hapd->msg_ctx_parent != hapd->msg_ctx)
                        wpa_msg_no_global(hapd->msg_ctx_parent, MSG_INFO,
-                                         AP_STA_CONNECTED "%s%s%s%s",
+                                         AP_STA_CONNECTED "%s%s%s%s%s",
                                          buf, ip_addr, keyid_buf,
-                                         dpp_pkhash_buf);
+                                         dpp_pkhash_buf, vlanid_buf);
        } else {
                wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);