Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH v2 2/4] scan: validate OWE transition operating class/channel
Date: Wed, 22 Sep 2021 12:34:16 -0700	[thread overview]
Message-ID: <20210922193418.13072-2-prestwoj@gmail.com> (raw)
In-Reply-To: 20210922193418.13072-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

If the IE's operating class and channel doesn't validate don't bother
storing the IE at all.
---
 src/scan.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/scan.c b/src/scan.c
index 54a7bc84..3f36ea3e 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -1063,11 +1063,19 @@ static void scan_parse_vendor_specific(struct scan_bss *bss, const void *data,
 		bss->owe_trans = l_new(struct ie_owe_transition_info, 1);
 
 		if (ie_parse_owe_transition(data - 2, len + 2,
-						bss->owe_trans) < 0) {
-			l_free(bss->owe_trans);
-			bss->owe_trans = NULL;
-		}
+						bss->owe_trans) < 0)
+			goto free_owe_trans;
+
+		if (bss->owe_trans->oper_class && oci_to_frequency(
+						bss->owe_trans->oper_class,
+						bss->owe_trans->channel) < 0)
+			goto free_owe_trans;
+
+		return;
 
+free_owe_trans:
+		l_free(bss->owe_trans);
+		bss->owe_trans = NULL;
 		return;
 	}
 
-- 
2.31.1

             reply	other threads:[~2021-09-22 19:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 19:34 James Prestwood [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-22 19:42 [PATCH v2 2/4] scan: validate OWE transition operating class/channel Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210922193418.13072-2-prestwoj@gmail.com \
    --to=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox