commit e8eb05feea2574507330932bfb69b226df9f18dd
parent dfe57b8bb05d1b4a4227f462dbe44a3491f75a88
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Mon, 10 May 2021 12:12:04 +0200
netdev: ensure DISCONNECT_BY_SME uses a reason_code
Station callbacks expect a reason code (as opposed to status codes) with
this event type.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/netdev.c b/src/netdev.c
@@ -771,10 +771,15 @@ static void netdev_connect_failed(struct netdev *netdev,
if (connect_cb)
connect_cb(netdev, result, &status_or_reason, connect_data);
- else if (event_filter)
+ else if (event_filter) {
+ /* NETDEV_EVENT_DISCONNECT_BY_SME expects a reason code */
+ if (result != NETDEV_RESULT_HANDSHAKE_FAILED)
+ status_or_reason = MMPDU_REASON_CODE_UNSPECIFIED;
+
event_filter(netdev, NETDEV_EVENT_DISCONNECT_BY_SME,
&status_or_reason,
connect_data);
+ }
}
static void netdev_disconnect_cb(struct l_genl_msg *msg, void *user_data)