]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
10 months agoFT: Discard EAPOL-Start frames when FT was used for association
Jouni Malinen [Thu, 12 Sep 2024 19:26:24 +0000 (22:26 +0300)] 
FT: Discard EAPOL-Start frames when FT was used for association

When FT is used, reauthentication to generate a new PMK-R0 would be
complicated since the current AP might not be the one with which the
currently used PMK-R0 was generated. IEEE Std 802.11-2020, 13.4.2 (FT
initial mobility domain association in an RSN) mandates STA to perform a
new FT initial mobility domain association whenever its Supplicant would
trigger sending of an EAPOL-Start frame.

Discard received EAPOL-Start frames from STAs that use FT to avoid
unexpected behavior. This is important in particular if a driver were to
allow unprotected EAPOL-Start frames to be processed when TK has been
configured.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agonl80211: Remove nl_msg free on send failure for NAN USD commands
Shivani Baranwal [Thu, 12 Sep 2024 12:19:03 +0000 (17:49 +0530)] 
nl80211: Remove nl_msg free on send failure for NAN USD commands

Remove nl_msg_free() after send failure for NAN USD commands. Freeing
the nl_msg is already taken care as part of send_and_recv_cmd() for both
success and failure cases.

Fixes: 58f04221fdef ("nl80211: NAN USD commands for offloading")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Fix pasn-resp fuzzing tester build
Jouni Malinen [Thu, 12 Sep 2024 18:33:30 +0000 (21:33 +0300)] 
PASN: Fix pasn-resp fuzzing tester build

The recently added calls to src/ap/pmksa_cache_auth.c needs to be faked
to allow pasn-resp to be built without having to pull in multiple
additional files from src/ap.

Fixes: b7de417c8a47 ("PASN: Define PMKSA helper functions for initiator and responder")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoPASN: Fix fuzzing tester compilation after function prototype change
Jouni Malinen [Thu, 12 Sep 2024 18:26:03 +0000 (21:26 +0300)] 
PASN: Fix fuzzing tester compilation after function prototype change

Addition of the new argument to handle_auth_pasn_1() forgot to update
testing code.

Fixes: 8f21cdf9d765 ("PASN: Add support to reject PASN auth 1 based on user input")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoP2P2: Add alternative PASN RX handler
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Add alternative PASN RX handler

This is needed for P2P2 pairing using PASN. The actual processing will
be covered in separate commits.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoSAE: Mark the groups argument to sae_derive_pt() const
Jouni Malinen [Wed, 11 Sep 2024 18:15:37 +0000 (21:15 +0300)] 
SAE: Mark the groups argument to sae_derive_pt() const

This makes it clearer that the list of groups is not going to be
modified.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agonl80211: Fix conditional checks of nlmsg attributes for NAN publish
Shivani Baranwal [Sat, 7 Sep 2024 13:45:42 +0000 (19:15 +0530)] 
nl80211: Fix conditional checks of nlmsg attributes for NAN publish

Some of the cleanup changes had lost the "goto fail" and broken the
logic. Restore correct behavior.

Fixes: 58f04221fdef ("nl80211: NAN USD commands for offloading")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agowlantest: Adjust kdk_len according to RSNX capability for FT roaming cases
Veerendranath Jakkam [Wed, 11 Sep 2024 13:29:44 +0000 (18:59 +0530)] 
wlantest: Adjust kdk_len according to RSNX capability for FT roaming cases

This is needed to derive the PTK correct when Secure LTF support is used
and the additional KDK component needs to be considered.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agoFix documentation for vendor interface command
Shivani Baranwal [Mon, 9 Sep 2024 04:48:31 +0000 (10:18 +0530)] 
Fix documentation for vendor interface command

Fix the placement of documentation of attribute used for the
QCA_NL80211_VENDOR_SUBCMD_CONNECT_EXT command.

Fixes: 97c6ef258890 ("QCA vendor interface to set the P2P mode configuration")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoInclude the NAN header file into driver.h to avoid C++ constraints
Shivani Baranwal [Tue, 3 Sep 2024 08:38:41 +0000 (14:08 +0530)] 
Include the NAN header file into driver.h to avoid C++ constraints

Include src/common/nan.h file into src/drivers/driver.h to resolve the
compilation issue "ISO C++ forbids forward references to 'enum' types"
by pulling in the full definition of enum nan_service_protocol_type.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agotests: SAE anti-clogging token with MLO
Jouni Malinen [Wed, 11 Sep 2024 09:58:43 +0000 (12:58 +0300)] 
tests: SAE anti-clogging token with MLO

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agonl80211: Check nla_parse_nested() result
Jouni Malinen [Thu, 5 Sep 2024 21:53:30 +0000 (00:53 +0300)] 
nl80211: Check nla_parse_nested() result

This recently added instance did not verify that parsing of nested
attributes succeeded.

Fixes: 15bf093b5b48 ("hostapd: Fetch multiple radios information from the driver")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoAP MLD: Fix link_id validity check for own links
Jouni Malinen [Thu, 5 Sep 2024 21:47:29 +0000 (00:47 +0300)] 
AP MLD: Fix link_id validity check for own links

The check against MAX_NUM_MLD_LINKS was off by one for the loop that
goes through hapd->partner_links[]. It does not look like this would
actually result in any real issues since the loop is on own set of
configured links. Anyway, it is better to have the bounds checking
accurate.

Fixes: 2042cae9b3a4 ("AP MLD: Generate and keep per STA profiles for each link")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoPass CSA parameters by reference instead by value
Jouni Malinen [Thu, 5 Sep 2024 21:42:26 +0000 (00:42 +0300)] 
Pass CSA parameters by reference instead by value

There is no need to make a copy of the full struct csa_settings for
this.

Fixes: 5cb6747f9721 ("Add support to switch channel when CAC is in progress")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoAdd QCA vendor subcommand to trigger Channel Usage Request
Shivani Baranwal [Thu, 15 Aug 2024 15:48:15 +0000 (21:18 +0530)] 
Add QCA vendor subcommand to trigger Channel Usage Request

Add a new QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_CHAN_USAGE_REQ
to support Channel Usage Request. It carries channel usage information
for BSSs that are not infrastructure BSSs or an off channel TDLS direct
link.

Implementation and scheduling of Channel Usage frames are present in the
driver/firmware. One of the key reason for this is that the TSF
timestamp required to be filled in these frames is available only in the
firmware.  So, this interface is used to configure the required
parameters to the driver/firmware for Channel Usage Request frame.

This uses attributes defined in enum
qca_wlan_vendor_attr_chan_usage_req.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoQCA vendor test configuration to add random PMKIDs in RSNE
Veerendranath Jakkam [Mon, 2 Sep 2024 07:27:05 +0000 (12:57 +0530)] 
QCA vendor test configuration to add random PMKIDs in RSNE

Add QCA vendor test configuration interface to add random PMKIDs in the
RSNE of the (Re)Association Request frames.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agoPASN: Allow frequency to be set for responder
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
PASN: Allow frequency to be set for responder

This will be needed for P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Parse new attributes
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Parse new attributes

Recognize new attributes when parsing P2P2 IE.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Add PMKSA caches for PASN initiator and responder
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Add PMKSA caches for PASN initiator and responder

These are needed for pairing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Use allocated memory for RSNXE and allow its contents to be set
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
PASN: Use allocated memory for RSNXE and allow its contents to be set

This will be needed for P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: PASN Encrypted Data element parsing
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
PASN: PASN Encrypted Data element parsing

Add the PASN Encrypted Data element from IEEE P802.11bh/D6.0 into the
element parser. This is needed for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Export p2p_build_go_neg_req()
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Export p2p_build_go_neg_req()

This is needed for PASN pairing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P: Debug print details on address mapping errors
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P: Debug print details on address mapping errors

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agonl80211: Configure capability flag for NAN USD offload
Shivani Baranwal [Sun, 18 Aug 2024 10:35:20 +0000 (16:05 +0530)] 
nl80211: Configure capability flag for NAN USD offload

Configure the capability flag based on the nl80211 feature advertisement
for NAN USD offload support.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoAdd QCA vendor feature flags to indicate NAN USD offload support
Vinay Gannevaram [Sun, 18 Aug 2024 10:30:26 +0000 (16:00 +0530)] 
Add QCA vendor feature flags to indicate NAN USD offload support

Add a separate feature flag to indicate support for NAN USD offload
feature.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
10 months agonl80211: NAN USD commands for offloading
Shivani Baranwal [Tue, 14 May 2024 06:12:59 +0000 (11:42 +0530)] 
nl80211: NAN USD commands for offloading

Add driver nl80211 support for the NAN USD flush, publish, subscribe,
update publish, cancel publish and cancel subscribe commands for cases
where these operations are offloaded to the driver
(WPA_DRIVER_FLAGS2_NAN_OFFLOAD).

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Do not include WPS IE in GO Negotiation
Shivani Baranwal [Sun, 4 Aug 2024 21:03:48 +0000 (02:33 +0530)] 
P2P2: Do not include WPS IE in GO Negotiation

Do not include WPS IE when going through GO Negotiation with a P2P2
peer.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Fragment P2P IE if subelements are too long in GO Negotiation
Shivani Baranwal [Sun, 4 Aug 2024 21:03:48 +0000 (02:33 +0530)] 
P2P2: Fragment P2P IE if subelements are too long in GO Negotiation

Add a function to fragment P2P/P2P2 IE exceeding 255 bytes in size and
use this for P2P IE in GO Negotiation frames in preparation for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: GO Negotiation Action frame contents for wrapped case
Shivani Baranwal [Sun, 4 Aug 2024 20:56:10 +0000 (02:26 +0530)] 
P2P2: GO Negotiation Action frame contents for wrapped case

Support generation of the GO Negotiation frames with contents that is
needed for P2P2 wrapped case.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P: Use enum p2p_status_code more consistently for PD
Jouni Malinen [Wed, 4 Sep 2024 08:19:21 +0000 (11:19 +0300)] 
P2P: Use enum p2p_status_code more consistently for PD

It is clearer to use enum p2p_status_code instead of u8 when processing
and passing the P2P Status Code to other components.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoP2P2: Refactor GO Negotiation and Invitation processing
Shivani Baranwal [Sun, 4 Aug 2024 20:42:10 +0000 (02:12 +0530)] 
P2P2: Refactor GO Negotiation and Invitation processing

Add wrapper functions to process and prepare a response for GO
Negotiation and Invitation frames. Send the response Action frames in
handle_ functions. This is in preparation for encapsulating these
messages within PASN Authentication frames for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Define PMKSA helper functions for initiator and responder
Shivani Baranwal [Sun, 4 Aug 2024 20:13:58 +0000 (01:43 +0530)] 
PASN: Define PMKSA helper functions for initiator and responder

Define helper functions to init, add, get, remove, flush, and deinit
PMKSA cache for PASN initiator and responder. P2P devices can be in
a role of pairing initiator and responder. Hence define a cache for
each role separately.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Optional KEK derivation in PTK
Shivani Baranwal [Sun, 4 Aug 2024 20:02:07 +0000 (01:32 +0530)] 
PASN: Optional KEK derivation in PTK

Add support to derive KEK in PTK per IEEE P802.11bh/D6.0. This can be
used to encrypt keys and passwords in opportunistic P2P pairing defined
in P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Notify bootstrapping request and completed events
Shivani Baranwal [Thu, 30 May 2024 19:53:51 +0000 (01:23 +0530)] 
P2P2: Notify bootstrapping request and completed events

Add support to notify P2P2 bootstrapping request and completed events to
the user.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Add a new method to P2P_CONNECT control interface command
Shivani Baranwal [Fri, 30 Aug 2024 16:41:17 +0000 (22:11 +0530)] 
P2P2: Add a new method to P2P_CONNECT control interface command

Add a new method "pair" to indicate the connect request perform the
Wi-Fi Direct R2 methods like bootstrapping and pairing for connection.
This fixes control interface command parsing which expects method as
mandatory.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agohostapd: Do not indicate a punctured secondary channel in HT operation
Michael-CY Lee [Mon, 19 Aug 2024 02:54:10 +0000 (10:54 +0800)] 
hostapd: Do not indicate a punctured secondary channel in HT operation

If the secondary channel is punctured, the HT operation in the Beacon
frames should not indicate a secondary channel offset.

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
11 months agomacsec_linux: Hardware offload requires Linux headers >= v5.7
Sergey Matyukevich [Wed, 21 Aug 2024 21:03:41 +0000 (00:03 +0300)] 
macsec_linux: Hardware offload requires Linux headers >= v5.7

Hardware offload in Linux macsec driver is enabled in compile time if
libnl version is >= v3.6. This is not sufficient for successful build
since enum 'macsec_offload' has been added to Linux header if_link.h
in kernels v5.6 and v5.7, see commits:
- https://github.com/torvalds/linux/commit/21114b7feec29e4425a3ac48a037569c016a46c8
- https://github.com/torvalds/linux/commit/76564261a7db80c5f5c624e0122a28787f266bdf

New libnl with older Linux headers is a valid combination. This is how
hostapd build failure has been detected by Buildroot autobuilder, see:
- http://autobuild.buildroot.net/results/b59d5bc5bd17683a3a1e3577c40c802e81911f84/

Extend compile time condition for the enablement of the macsec hardware
offload adding Linux headers version check.

Fixes: 40c139664439 ("macsec_linux: Add support for MACsec hardware offload")
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
11 months agotests: DPP and SAE password identifier
Jouni Malinen [Sun, 1 Sep 2024 13:33:26 +0000 (16:33 +0300)] 
tests: DPP and SAE password identifier

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoDPP: Support for provisioning SAE password identifiers (Configurator)
Jouni Malinen [Sun, 1 Sep 2024 13:32:39 +0000 (16:32 +0300)] 
DPP: Support for provisioning SAE password identifiers (Configurator)

Allow SAE password identifiers to be provisioned to Enrollees that
indicate support for this capability.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoDPP: Support for provisioning SAE password identifiers (Enrollee)
Dan Harkins [Fri, 23 Aug 2024 17:50:36 +0000 (10:50 -0700)] 
DPP: Support for provisioning SAE password identifiers (Enrollee)

DPP supports provisioning of SAE password identifiers to uniquely
identify a password if the enrollee indicates support for them. Indicate
Enrollee support for that and add the received value into the network
profile.

I put everything under defines for CONFIG_DPP3 as this is a bleeding
edge feature in DPP.

This was tested against my DPP reference implementation acting as the
Configurator.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
11 months agonl80211: Pass "global" events to all interfaces
Cermak Dominik [Thu, 29 Aug 2024 08:01:21 +0000 (08:01 +0000)] 
nl80211: Pass "global" events to all interfaces

We got connection failures because of outdated channel information.
That's because the NL80211_CMD_REG_CHANGE event is important for all
interfaces.

Commit f13683720239 ("nl80211: Pass wiphy events to all affected
interfaces") skips the early termination for events directed to a wiphy,
but that doesn't cover the regulatory change event because it doesn't
have a wiphy set either. Therefore the early termination still kicks in
and from three interfaces, only one got the updated channel list.

Fix this by changing the early termination logic to only apply to events
directed either to a specific interface index for wdev.

Signed-off-by: Dominik Cermak <dominik.cermak@joynext.com>
11 months agoAP MLD: Check SAE message length without depending on pointer arithemetic
Jouni Malinen [Sun, 1 Sep 2024 10:24:29 +0000 (13:24 +0300)] 
AP MLD: Check SAE message length without depending on pointer arithemetic

The way this was checked previously used pointer arithmetic could result
in undefined behavior due to the pointer ending up pointing more than
one byte beyond the end of the buffer. Avoid this by checking the buffer
length before incrementing the pointer.

Fixes: bcbe80a66a9b ("AP: MLO: Handle Multi-Link element during authentication")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoAP MLD: Work around delayed STA entry addition for SAE confirm
Jouni Malinen [Sun, 1 Sep 2024 10:14:12 +0000 (13:14 +0300)] 
AP MLD: Work around delayed STA entry addition for SAE confirm

The driver is expected to have an STA entry for a non-AP MLD ready to
translate the address fields for SAE confirm messages. However, there is
at least a theoretical race condition in a case where the peer sends the
SAE confirm message quickly enough for the driver translation mechanism
to not be available to update the SAE confirm message addresses. Work
around that by searching for the STA entry using the link address of the
non-AP MLD if no match is found based on the MLD MAC address.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: AP MLD control socket connectivity test case
Aditya Kumar Singh [Tue, 13 Aug 2024 08:38:52 +0000 (14:08 +0530)] 
tests: AP MLD control socket connectivity test case

Add a simple test case to bring up a two link AP MLD and get the status
of each link via the MLD level control socket.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agoAP MLD: Introduce MLD level control interface socket
Aditya Kumar Singh [Tue, 13 Aug 2024 08:38:48 +0000 (14:08 +0530)] 
AP MLD: Introduce MLD level control interface socket

With MLO, each link have socket created with "<ifname>_link<link id>"
under the control interface directory.

Introduce a MLD level socket "<ifname>" as well under the same control
interface directory. This socket can be used to pass the command to its
partner links directly instead of using the link level socket. Link ID
needs to be passed with the command in a prefix way. If no Link ID is
provided the first link ID is selected.

The structure of the command is -
 "LINKID <link id> <COMMAND APPLICABALE FOR THE LINK>"

Directory looks something like this -
  $ ls /var/run/hostapd/
    wlan0
    wlan0_link0
    wlan0_link1

wlan0 here is the MLD level socket. Rest are each link level sockets.

This also helps to maintain backwards compatibility with applications
which looks for <ifname> under the control interface directory.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agotests: MLO: Use link ID to access control sockets
Aditya Kumar Singh [Tue, 13 Aug 2024 08:38:51 +0000 (14:08 +0530)] 
tests: MLO: Use link ID to access control sockets

With MLO, each BSS will create sockets under the given ctrl_iface
directory with the socket name being '<ifname>_link<link_ID>'.

Make necessary changes in MLO related test cases so that it can access
the new socket and proceed further as expected.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agoAP MLD: Create link based hostapd control sockets
Karthikeyan Kathirvel [Tue, 13 Aug 2024 08:38:47 +0000 (14:08 +0530)] 
AP MLD: Create link based hostapd control sockets

Create link based control sockets to access the link based commands
through hostapd_cli. This will create the link interfaces in the name of
<ifname>_link<X>

Example:
To fetch link 0 status from wlan0, below command can be used -
    $ hostapd_cli -i wlan0 -l 0 status

On failure of link/interface selection, below error will be observed
    $ hostapd_cli -i wlan0 -l 2 status
    Failed to connect to hostapd - wpa_ctrl_open: No such file or directory

Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
Co-developed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agotests: Clear scan cache in wifi_display_parsing
Jouni Malinen [Thu, 29 Aug 2024 17:21:31 +0000 (20:21 +0300)] 
tests: Clear scan cache in wifi_display_parsing

This is needed to avoid false failures if an old BSS entry is still
present for dev[0]. This could happen, e.g., with the following test
case sequence: wpas_mesh_max_peering wifi_display_parsing

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoAdd QCA vendor attribute to disable channel switch initiation
Shivani Baranwal [Fri, 16 Aug 2024 07:14:36 +0000 (12:44 +0530)] 
Add QCA vendor attribute to disable channel switch initiation

Add a test config u8 attribute to disable the channel switch
initiation in P2P GO mode.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agotests: Make rsn_override_mld_too_long_elems more robust
Jouni Malinen [Thu, 29 Aug 2024 13:14:43 +0000 (16:14 +0300)] 
tests: Make rsn_override_mld_too_long_elems more robust

Wait longer for the disconnection event since the previous wait was
exactly the same length as the authentication timeout in wpa_supplicant
and as such, subject to race conditions.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: More robust error handling for wifi_display_parsing
Jouni Malinen [Thu, 29 Aug 2024 13:00:10 +0000 (16:00 +0300)] 
tests: More robust error handling for wifi_display_parsing

Check explicitly that wfd_subelems is present in the dict instead of
failing on a key error when trying to fetch it.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoUSD: Move control interface events to notify.c
Lo,Chin-Ran [Mon, 15 Jul 2024 06:01:11 +0000 (14:01 +0800)] 
USD: Move control interface events to notify.c

This separates the control interface specific generation of a text event
message away from the main implementation of USD and makes it more
convenient to add support for other control interface mechanisms like
dbus.

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
11 months agoQCA vendor interface to set the P2P mode configuration
Vinay Gannevaram [Wed, 14 Aug 2024 15:41:53 +0000 (21:11 +0530)] 
QCA vendor interface to set the P2P mode configuration

Add the QCA_NL80211_VENDOR_SUBCMD_SET_P2P_MODE for setting the P2P mode
in which the P2P Group Owner (GO) should be brought up. These modes
include Wi-Fi Direct R1 only, Wi-Fi Direct R2 only, and P2P Connection
Compatibility Mode, which supports both R1 and R2. These modes are
defined in the enum qca_wlan_vendor_p2p_mode.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
11 months agoAdd QCA vendor attribute to change P2P GO beacon interval
Kiran Kumar Lokere [Mon, 12 Aug 2024 07:26:57 +0000 (00:26 -0700)] 
Add QCA vendor attribute to change P2P GO beacon interval

Add new QCA vendor attribute to configure the P2P GO beacon interval
dynamically while the BSS continues operating.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoP2P2: Add bootstrapping support with PD frames
Shivani Baranwal [Mon, 5 Aug 2024 09:33:07 +0000 (15:03 +0530)] 
P2P2: Add bootstrapping support with PD frames

Add support for P2P2 bootstrapping with comeback mechanism using
Provision Discovery frames. Extend the control interface command
P2P_CONNECT to allow P2P2 bootstrapping handshake.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Refactor provision discovery request/response processing
Shivani Baranwal [Mon, 5 Aug 2024 09:33:06 +0000 (15:03 +0530)] 
P2P2: Refactor provision discovery request/response processing

Parse the P2P IEs in functions that handle provision discovery request
and response. Process the frames based on the IEs received in the PD
frames. This makes it easier to extend PD for P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Process Element container attribute from NAN SDFs
Shivani Baranwal [Mon, 5 Aug 2024 09:33:05 +0000 (15:03 +0530)] 
P2P2: Process Element container attribute from NAN SDFs

Process the Element Container attribute from NAN SDF frames and check if
P2P attributes are present. Add a P2P peer device entry if the NAN SDF
frame has matching service and P2P capabilities.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Parse P2P2 IE
Shivani Baranwal [Mon, 5 Aug 2024 09:33:05 +0000 (15:03 +0530)] 
P2P2: Parse P2P2 IE

Add parsing of the P2P2 IE similarly to the way the P2P IE is parsed.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoNAN USD: Add publishChannelList option for Subscriber
Shivani Baranwal [Mon, 5 Aug 2024 09:33:04 +0000 (15:03 +0530)] 
NAN USD: Add publishChannelList option for Subscriber

Add frequency list to active NAN USD Subscriber to search for a
Publisher on multiple channels. This is the publish channel list used by
the Subscriber to periodically search for a service on these channels.
publishChannelList was already supported in the Publisher and this
commit extends that to the Subscriber.

This is needed for a P2P2 seeker that is an active subscriber looking
for an advertiser on a list of publish channels.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Device Identity Key generation and storage in configuration
Shivani Baranwal [Mon, 5 Aug 2024 09:33:03 +0000 (15:03 +0530)] 
P2P2: Device Identity Key generation and storage in configuration

Generate a random device identity key and save it to the config file.
Use the same identity key from config to derive DIRA for NAN SDF frames.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoFT: Fix writing of ft_prepend_pmkid configuration parameter
Shivani Baranwal [Mon, 5 Aug 2024 09:33:03 +0000 (15:03 +0530)] 
FT: Fix writing of ft_prepend_pmkid configuration parameter

This was missing a newline at the end of the line.

Fixes: 8fa52a797496 ("FT: Allow wpa_supplicant to be configured to prepend PMKR1Name")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Add DIRA attributes to P2P2 IE of NAN SDFs
Shivani Baranwal [Mon, 5 Aug 2024 09:33:02 +0000 (15:03 +0530)] 
P2P2: Add DIRA attributes to P2P2 IE of NAN SDFs

Add DIRA attribute in P2P2 IE of NAN Subscribe and Publish frames
to enable support for device identity of paired peers.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Add PCEA and PBMA attributes to P2P2 IE of NAN SDFs
Shivani Baranwal [Mon, 5 Aug 2024 09:33:01 +0000 (15:03 +0530)] 
P2P2: Add PCEA and PBMA attributes to P2P2 IE of NAN SDFs

Add PCEA and PBMA attribute in P2P2 IE of NAN Subscribe and Publish frames
to include the P2P2 capabilities and bootstrapping methods.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: Allow P2P IE to be added into NAN SDFs
Shivani Baranwal [Mon, 5 Aug 2024 09:33:00 +0000 (15:03 +0530)] 
P2P2: Allow P2P IE to be added into NAN SDFs

Extend the NAN Subscribe and Publish methods to allow p2p=1 to be
specified to include P2P attributes in a P2P IE to be added into the NAN
Element Container attribute. In addition, use the P2P Device Address for
the NAN SDFs for the P2P cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoP2P2: New element and attribute definitions
Shivani Baranwal [Mon, 5 Aug 2024 09:33:00 +0000 (15:03 +0530)] 
P2P2: New element and attribute definitions

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agoNAN: Option to offload NAN DE for USD into the driver
Shivani Baranwal [Mon, 5 Aug 2024 09:32:59 +0000 (15:02 +0530)] 
NAN: Option to offload NAN DE for USD into the driver

Support implementation architecture where the NAN discovery engine is
located in the driver/firmware instead of wpa_supplicant.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
11 months agotests: AP MLD and RSN overriding with too long elements
Jouni Malinen [Fri, 23 Aug 2024 15:42:55 +0000 (18:42 +0300)] 
tests: AP MLD and RSN overriding with too long elements

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoRSNO: Check that RSNOE/RSNO2E/RSNXOE fit into RSN Override Link KDE
Jouni Malinen [Fri, 23 Aug 2024 15:40:53 +0000 (18:40 +0300)] 
RSNO: Check that RSNOE/RSNO2E/RSNXOE fit into RSN Override Link KDE

While these elements fit without issue in production use cases, it is
possible to override the elements for testing purposes and if such
overridden elements are overly long, they would nto fit into the maximum
length RSN Override Link KDE. This could result in difficult to debug
failure cases, so check for this explicitly and instead of sending out
the invalid M3, report the internal issue in the debug log and do not
send M3.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: RSNXE extensibility
Jouni Malinen [Fri, 23 Aug 2024 07:09:10 +0000 (10:09 +0300)] 
tests: RSNXE extensibility

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoAllow IE overriding to use maximum element length
Jouni Malinen [Fri, 23 Aug 2024 07:07:19 +0000 (10:07 +0300)] 
Allow IE overriding to use maximum element length

Elements can actually be 257 octets long (2 octets of header followed by
255 octets of payload). The maximum length for various IE override
testing parameters had somehow ended up being one octet too short to
cover the maximum. Increase this to allow the maximum element length to
be reached for testing purposes.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: Fix EHT 320 MHz tests to clear sae_groups
Jouni Malinen [Thu, 22 Aug 2024 09:09:20 +0000 (12:09 +0300)] 
tests: Fix EHT 320 MHz tests to clear sae_groups

These test cases could fail if they happened to be executed after a test
case that set a specific SAE group.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoPASN: Add a function to configure noauth variable
Shivam Rai [Mon, 5 Aug 2024 04:50:10 +0000 (10:20 +0530)] 
PASN: Add a function to configure noauth variable

When the PASN implementation is used as a library for Wi-Fi Aware
applications there is need to allow the Responder to set the noauth
parameter to support opportunistic pairing method using PASN AKMP. Add
pasn_set_noauth() to address this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoPASN: Add support to reject PASN auth 1 based on user input
Shivam Rai [Mon, 12 Aug 2024 06:09:46 +0000 (11:39 +0530)] 
PASN: Add support to reject PASN auth 1 based on user input

When the PASN implementation is used as a library for Wi-Fi Aware
applications there is need to reject the PASN auth 1 frame based on the
user input. Add support to send PASN auth 2 with failure status for
auth 1 frame received to address this need.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: DPP and SAE with short password
Jouni Malinen [Thu, 22 Aug 2024 08:27:00 +0000 (11:27 +0300)] 
tests: DPP and SAE with short password

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoDPP: Do not restrict SAE password length on Enrollee
Jouni Malinen [Thu, 22 Aug 2024 08:25:54 +0000 (11:25 +0300)] 
DPP: Do not restrict SAE password length on Enrollee

The restriction of the passphrase length to 8..63 characters is only
applicable for WPA2-Personal (PSK). Remove this constraint when
processing a configuration object that includes SAE without PSK.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoDPP: Do not restrict SAE password length on Configurator
Jouni Malinen [Thu, 22 Aug 2024 08:20:20 +0000 (11:20 +0300)] 
DPP: Do not restrict SAE password length on Configurator

The restriction of the passphrase length to 8..63 characters is only
applicable for WPA2-Personal (PSK). Remove this constraint when
provisioning a configuration object that includes SAE without PSK.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: RSN overriding and WPA3-Personal Compatibility Mode
Jouni Malinen [Tue, 20 Aug 2024 16:31:00 +0000 (19:31 +0300)] 
tests: RSN overriding and WPA3-Personal Compatibility Mode

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: RSN overriding enabled only on the STA
Jouni Malinen [Thu, 15 Aug 2024 17:24:34 +0000 (20:24 +0300)] 
tests: RSN overriding enabled only on the STA

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoRSNO: Always enable SNonce cookie and RSN Override elements validation
Veerendranath Jakkam [Tue, 13 Aug 2024 18:12:48 +0000 (23:42 +0530)] 
RSNO: Always enable SNonce cookie and RSN Override elements validation

Always set SNonce cookie and enable RSN Override elements validation
irrespective of the RSN Selection element usage in (Re)Association
Request frame when RSN overriding supported.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
11 months agoRSNO: Skip validating RSN Override elements with MLO when RSN overriding not used
Veerendranath Jakkam [Tue, 13 Aug 2024 17:32:55 +0000 (23:02 +0530)] 
RSNO: Skip validating RSN Override elements with MLO when RSN overriding not used

STA needs to skip validating RSN Override elements when RSN overriding
is not used since AP will not send RSN Override elements in EAPOL-Key
message 3/4. This is handled correctly in non-MLO case but in MLO case
wpa_supplicant always validates RSN Override link KDEs. Fix validating
RSN Override elements in MLO case as well.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
11 months agoRSNO: Do not enforce SNonce cookie and RSN Selection match if RSNO not used
Jouni Malinen [Thu, 15 Aug 2024 17:39:03 +0000 (20:39 +0300)] 
RSNO: Do not enforce SNonce cookie and RSN Selection match if RSNO not used

A STA that supports RSN overriding will always use the SNonce cookie. An
AP that does not advertise RSN overriding elements must not enforce that
SNonce cookie is used with RSN Selection element since a STA includes
the latter only when it sees the AP advertising RSN overriding elements.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoRSNO: Update RSN overriding capability indication to the driver
Veerendranath Jakkam [Thu, 8 Aug 2024 13:32:30 +0000 (19:02 +0530)] 
RSNO: Update RSN overriding capability indication to the driver

Modify wpa_supplicant code based on the updated driver interface for RSN
overriding capability indication.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
11 months agoMore detailed documentation for QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES
Jouni Malinen [Tue, 13 Aug 2024 21:40:50 +0000 (00:40 +0300)] 
More detailed documentation for QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES

Be more specific on how the QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS attribute
is used in the response.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoQCA vendor interface for indicating supplicant support for RSN overriding
Veerendranath Jakkam [Thu, 8 Aug 2024 12:52:34 +0000 (18:22 +0530)] 
QCA vendor interface for indicating supplicant support for RSN overriding

Add QCA_NL80211_VENDOR_SUBCMD_CONNECT_EXT to send additional information
such as RSN overriding support of the supplicant for the (re)association
attempts with NL80211_CMD_CONNECT.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
11 months agoUse QCA_WLAN_VENDOR_FEATURE_RSN_OVERRIDE_STA only for indicating driver support
Veerendranath Jakkam [Thu, 8 Aug 2024 12:25:25 +0000 (17:55 +0530)] 
Use QCA_WLAN_VENDOR_FEATURE_RSN_OVERRIDE_STA only for indicating driver support

Use separate interfaces for indicating driver and supplicant RSN
overriding support. Modifying this interface is fine since this feature
is still under development.

Subsequent commit will define the interface for indicating supplicant
RSN overriding support to the driver.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
11 months agotests: Enable MLD GTK rekey test
Aditya Kumar Singh [Mon, 12 Aug 2024 09:02:53 +0000 (14:32 +0530)] 
tests: Enable MLD GTK rekey test

Now that MLO GTK rekey support is added, enable the test case fully.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agoAP MLD: Fix PN/IPN/BIPN for group rekeying
Aditya Kumar Singh [Tue, 13 Aug 2024 12:50:55 +0000 (18:20 +0530)] 
AP MLD: Fix PN/IPN/BIPN for group rekeying

wpa_auth_get_seqnum() for ML group rekeying needs to be skipped in the
same way as it is done for non-ML cases to avoid indicating old values
and resulting in group frames being dropped as replays. The simple check
for gsm->wpa_group_state != WPA_GROUP_SETKEYS (as is done for non-ML) is
not sufficient for this since the per-link Authenticator states are not
strictly synchronized and the state change happens in the middle of this
step.

Fixes: 137b85509248 ("MLO: Mechanism for fetching group key information for the links")
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agoAP MLD: Fix ML STA wpa_group update during rekey
Rameshkumar Sundaram [Mon, 12 Aug 2024 09:02:51 +0000 (14:32 +0530)] 
AP MLD: Fix ML STA wpa_group update during rekey

At present, group key update is not confined only on the association
link as originally intended. Hence, ensure now that the group key update
is only performed on the association link for non-AP MLDs.

This was missed during adding support for group rekeying for MLO.

Fixes: 12acda633b50 ("AP MLD: Support group rekeying for MLO")
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agotests: Group rekeying with VLANs
Jouni Malinen [Tue, 13 Aug 2024 09:48:25 +0000 (12:48 +0300)] 
tests: Group rekeying with VLANs

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoFix GKeyDoneStations tracking for VLAN
Jouni Malinen [Tue, 13 Aug 2024 09:55:16 +0000 (12:55 +0300)] 
Fix GKeyDoneStations tracking for VLAN

The AP MLD change to use a helper function for this broke the design
that depends on the value for sm->group (i.e., the currently assigned
VLAN) being used instead of the sm->wpa_auth->group. Restore previous
behavior to fix GKeyDoneStations tracking when VLANs are used.

Fixes: 78adbf2c08f4 ("AP MLD: Mark GKeyDone completed for STAs in a helper function")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agotests: Fix duplicate test case name
Jouni Malinen [Tue, 13 Aug 2024 08:44:09 +0000 (11:44 +0300)] 
tests: Fix duplicate test case name

The new test case for an AP MLD in a bridge was supposed to use a unique
test name to avoid hiding an existing test case.

Fixes: c4f927926765 ("tests: AP MLD with two links in a bridge")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agonl80211: Add AP_VLAN interface to bridge after interface is up
Radha Krishna Simha Jiguru [Wed, 17 Jul 2024 16:57:39 +0000 (22:27 +0530)] 
nl80211: Add AP_VLAN interface to bridge after interface is up

In the current hostapd flow, AP_VLAN net device is added to a bridge
before the interface is brought up.

Interface up event is used in mac80211 layer for setting device context
in the driver. Vendor specific datapath offload configurations for net
device might also be set up in interface up event context. Adding
AP_VLAN interface to a bridge before the UP event could cause
inconsistent state for datapath offload context setup in a vendor
driver.

Change the sequence to add AP_VLAN interface to a bridge after the
interface is set up. This makes the interface up and bridge add sequence
for AP_VLAN to be consistent with that of a regular AP interface.

Signed-off-by: Radha Krishna Simha Jiguru <quic_rjiguru@quicinc.com>
11 months agotests: AP MLD with two links in a bridge
Jouni Malinen [Mon, 12 Aug 2024 09:11:39 +0000 (12:11 +0300)] 
tests: AP MLD with two links in a bridge

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
11 months agoAP MLD: Add links to bridge FDB for FT roaming
Karthikeyan Kathirvel [Tue, 9 Apr 2024 17:23:46 +0000 (22:53 +0530)] 
AP MLD: Add links to bridge FDB for FT roaming

During FT, RRB messages are getting dropped at bridge on an AP MLD since
bridge doesn't know all the link address, so roaming gets failed.

Add AP MLD's each link address to the bridge FDB, so that RRB frames
get forwarded through bridge to hostapd.

Co-developed-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
11 months agotests: hostapd error path on driver interface initialization failure
Jouni Malinen [Sat, 10 Aug 2024 07:30:07 +0000 (10:30 +0300)] 
tests: hostapd error path on driver interface initialization failure

Signed-off-by: Jouni Malinen <j@w1.fi>
11 months agonl80211: NULL pointer check for link before use
Jintao Lin [Fri, 9 Aug 2024 18:10:34 +0000 (18:10 +0000)] 
nl80211: NULL pointer check for link before use

bss->flink could be NULL when wpa_driver_nl80211_del_beacon() is called
if wpa_driver_nl80211_drv_init() fails early through the 'failed' label
and jumps to wpa_driver_nl80211_deinit() with bss->flink unset.

Fixes: 47269be36e61 ("nl80211: Refactor i802_bss to support multiple links")
Signed-off-by: Jintao Lin <jintaolin@chromium.org>
11 months agohostapd: Avoid channel selection across underlying hardware index
Aditya Kumar Singh [Wed, 24 Jul 2024 07:08:14 +0000 (12:38 +0530)] 
hostapd: Avoid channel selection across underlying hardware index

Currently, channel is selected from the current hw_mode. However, not
all channels under current hw_mode might be available for the current
operating underlying hardware.

Add logic to check if the selected channel falls under the current
operating hardware index and only if so, continue with the selected
channel.

Co-developed-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agohostapd: Fetch multiple radios information from the driver
Aditya Kumar Singh [Wed, 24 Jul 2024 07:08:13 +0000 (12:38 +0530)] 
hostapd: Fetch multiple radios information from the driver

When a driver consolidates several hardware components under a single
radio, it provides details about these components via the
NL80211_CMD_GET_WIPHY command.

Parse this information and store it. A subsequent change will use this
information for validation in certain scenarios.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11 months agoSync with wireless-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 9 Aug 2024 17:26:01 +0000 (20:26 +0300)] 
Sync with wireless-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2024-07-09.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 months agonl80211: MLD: Fix is_shared_drv ops logic when num links is one
Ganesh Kariganuru Mahabalesh [Thu, 25 Apr 2024 10:15:25 +0000 (15:45 +0530)] 
nl80211: MLD: Fix is_shared_drv ops logic when num links is one

Whenever there is only one BSS left and if the number of links is one,
is_shared_drv() returns false assuming no one else is sharing the driver
interface. However, when the number of links is one, this does not
guarantee that the caller's link ID is the only active link ID. If this
is not the case and false is returned, the caller calls hapd_deinit()
which will free the driver interface. However, when the actual active
link_id reaches deinit path, this leads to dereferencing a NULL pointer
ultimately leading to segmentation fault.

To prevent this, pass the link ID into the is_drv_shared() ops and match
it with only with active link IDs. Only return false if they are same.

Signed-off-by: Ganesh Kariganuru Mahabalesh <quic_gkarigan@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>