]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
NAN: Reject undefined publish type
authorChien Wong <m@xv97.com>
Sat, 27 Apr 2024 08:19:44 +0000 (16:19 +0800)
committerJouni Malinen <j@w1.fi>
Fri, 12 Jul 2024 13:37:01 +0000 (16:37 +0300)
The Wi-Fi Aware Specification v4.0 only defines unsolicited
transmissions only, solicited transmissions only and both unsolicited
and solicited transmissions publish. The other possibility is undefined
so we should reject it.

Signed-off-by: Chien Wong <m@xv97.com>
src/common/nan_de.c

index e1999a06bece442eb440177d49068a885517aa42..12fad3112bdc96e930dff0ed78c64211a183856b 100644 (file)
@@ -1209,6 +1209,12 @@ int nan_de_publish(struct nan_de *de, const char *service_name,
                return -1;
        }
 
+       if (!params->unsolicited && !params->solicited) {
+               wpa_printf(MSG_INFO,
+                          "NAN: Publish() - both unsolicited and solicited disabled is invalid");
+               return -1;
+       }
+
        publish_id = nan_de_get_handle(de);
        if (publish_id < 1)
                return -1;