]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
op_classes: Don't report an error when there are none to add
authorRoy Marples <roy@marples.name>
Tue, 21 Jul 2020 12:17:41 +0000 (13:17 +0100)
committerJouni Malinen <j@w1.fi>
Fri, 9 Oct 2020 13:50:36 +0000 (16:50 +0300)
Instead, log a diagnostic so that noise to the user is reduced. This is
expected behavior with driver interfaces that do not report supported
operating modes/classes.

Signed-off-by: Roy Marples <roy@marples.name>
wpa_supplicant/op_classes.c

index bd97fee54b2ce0641acac5342fb45a93bd0eacb1..91e15e7995538421193d10cd23cab013b8bc4ef5 100644 (file)
@@ -412,9 +412,13 @@ size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
        }
 
        *ie_len = wpabuf_len(buf) - 2;
-       if (*ie_len < 2 || wpabuf_len(buf) > len) {
+       if (*ie_len < 2) {
+               wpa_printf(MSG_DEBUG,
+                          "No supported operating classes IE to add");
+               res = 0;
+       } else if (wpabuf_len(buf) > len) {
                wpa_printf(MSG_ERROR,
-                          "Failed to add supported operating classes IE");
+                          "Supported operating classes IE exceeds maximum buffer length");
                res = 0;
        } else {
                os_memcpy(pos, wpabuf_head(buf), wpabuf_len(buf));