From 41740ceabc6c4989c0acf74b3b4c9d1559ee08dd Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 21 Aug 2019 15:32:31 -0700 Subject: [PATCH] scan: only set Interworking if capable Checks that the extended capabilities has the Interworking bit set before adding the IE. --- src/scan.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/scan.c b/src/scan.c index 3365c4c5..6886fbb7 100644 --- a/src/scan.c +++ b/src/scan.c @@ -303,14 +303,17 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc, iov[iov_elems].iov_len = ext_capa[1] + 2; iov_elems++; - /* Order 12 - Interworking */ - interworking[0] = IE_TYPE_INTERWORKING; - interworking[1] = 1; - interworking[2] = 0; /* Private network, INet=0,ASRA=0,ESR=0,UESA=0 */ + if (util_is_bit_set(ext_capa[3], 7)) { + /* Order 12 - Interworking */ + interworking[0] = IE_TYPE_INTERWORKING; + interworking[1] = 1; + /* Private network, INet=0,ASRA=0,ESR=0,UESA=0 */ + interworking[2] = 0; - iov[iov_elems].iov_base = interworking; - iov[iov_elems].iov_len = 3; - iov_elems++; + iov[iov_elems].iov_base = interworking; + iov[iov_elems].iov_len = 3; + iov_elems++; + } /* Order Last (assuming WSC vendor specific) */ if (params->extra_ie && params->extra_ie_size) {