From cb76f219fb3d0afd189f0a58e258577035f7431a Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 5 Apr 2022 11:21:41 -0700 Subject: [PATCH] netdev: move ocvc setting to after connected check We cannot check 'handshake' until first checking that IWD is connected. --- src/netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index 5ec7fe4a..e483edf8 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -4990,8 +4990,7 @@ static void netdev_sa_query_req_frame_event(const struct mmpdu_header *hdr, uint16_t transaction; const uint8_t *oci; struct netdev *netdev = user_data; - bool ocvc = netdev->handshake->supplicant_ocvc && - netdev->handshake->authenticator_ocvc; + bool ocvc; if (body_len < 4) { l_debug("SA Query request too short"); @@ -5001,6 +5000,9 @@ static void netdev_sa_query_req_frame_event(const struct mmpdu_header *hdr, if (!netdev->connected) return; + ocvc = netdev->handshake->supplicant_ocvc && + netdev->handshake->authenticator_ocvc; + /* only care about SA Queries from our connected AP */ if (memcmp(hdr->address_2, netdev->handshake->aa, 6)) return;