]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Add some more debug prints on GAS frame parsing errors
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Fri, 23 Jan 2026 15:21:50 +0000 (17:21 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 23 Jan 2026 15:21:50 +0000 (17:21 +0200)
These cases were referenced in a hwsim test case
dpp_hostapd_enrollee_gas_proto, but hostapd did not actually print the
matching strings into debug log.

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

index a471c793c41352d496c0d58d02c25f29d445e138..5629e20909e30bf5b6162a111e58d67351363baf 100644 (file)
@@ -536,16 +536,24 @@ int gas_query_ap_rx(struct gas_query_ap *gas, const u8 *sa, u8 categ,
        }
 
        if (action == WLAN_PA_GAS_COMEBACK_RESP) {
-               if (pos + 1 > data + len)
+               if (pos + 1 > data + len) {
+                       wpa_printf(MSG_DEBUG,
+                                  "GAS: No room for frag_id in the response from "
+                                  MACSTR, MAC2STR(sa));
                        return 0;
+               }
                frag_id = *pos & 0x7f;
                more_frags = (*pos & 0x80) >> 7;
                pos++;
        }
 
        /* Comeback Delay */
-       if (pos + 2 > data + len)
+       if (pos + 2 > data + len) {
+               wpa_printf(MSG_DEBUG,
+                          "GAS: No room for Comeback Delay in the response from "
+                          MACSTR, MAC2STR(sa));
                return 0;
+       }
        comeback_delay = WPA_GET_LE16(pos);
        if (comeback_delay > GAS_QUERY_MAX_COMEBACK_DELAY)
                comeback_delay = GAS_QUERY_MAX_COMEBACK_DELAY;