]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Mark last BSS entry by #### instead of ====
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 28 Feb 2013 16:46:06 +0000 (18:46 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 28 Feb 2013 16:46:06 +0000 (18:46 +0200)
This allows ctrl_iface users to iterate through the BSS entries by
fetching multiple BSS entries with "BSS RANGE=N-" without having to use
one extra round to get empty return value as the indication of the last
entry having been found.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
wpa_supplicant/ctrl_iface.c

index 65a769e537010098a28dbc2ed9249d0b363c842c..f8e0f3e492185bcfd73250dfbbaa0f7f7f5d3cb7 100644 (file)
@@ -3353,8 +3353,13 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
                ret += len;
                buf += len;
                buflen -= len;
-               if (bss == bsslast)
+               if (bss == bsslast) {
+                       if ((mask & WPA_BSS_MASK_DELIM) && len &&
+                           (bss == dl_list_last(&wpa_s->bss_id,
+                                                struct wpa_bss, list_id)))
+                               os_snprintf(buf - 5, 5, "####\n");
                        break;
+               }
                next = bss->list_id.next;
                if (next == &wpa_s->bss_id)
                        break;