]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agoUpdate AP IE regardless WPA_DRIVER_FLAGS_BSS_SELECTION flag android-m
Dmitry Shmidt [Fri, 15 Feb 2013 00:44:44 +0000 (16:44 -0800)] 
Update AP IE regardless WPA_DRIVER_FLAGS_BSS_SELECTION flag

Change-Id: Ia2b0aea81e250cfd989861ed37551ca8c41f7a66
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
(cherry picked from commit 18306c6ac9281cca7d986a0d780047df0f32675f)

Conflicts:
wpa_supplicant/events.c

8 years agoAOSP: Android: Add src directory symlinks
Dmitry Shmidt [Tue, 15 Nov 2011 14:00:34 +0000 (16:00 +0200)] 
AOSP: Android: Add src directory symlinks

These are from Android wpa_supplicant_8.git initial 0.8.X commit
8d520ff1dc2da35cdca849e982051b86468016d8.

Change-Id: I26aec5afbbd4f4a1f5fd900912545b6f5050de64
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
(cherry picked from commit 05d4c3aec6024ed308d640d68f91ab4e926fd79d)

8 years agoAOSP: Add CleanSpec.mk
Jouni Malinen [Tue, 6 Oct 2015 12:33:25 +0000 (15:33 +0300)] 
AOSP: Add CleanSpec.mk

This is a snapshot from AOSP commit
0a67fb8a30fa69ee3b158f981bb1f6865bfbdef5.

8 years agoAOSP: Android: Add MODULE_LICENSE_BSD_LIKE
Dmitry Shmidt [Tue, 15 Nov 2011 13:58:56 +0000 (15:58 +0200)] 
AOSP: Android: Add MODULE_LICENSE_BSD_LIKE

These are from Android wpa_supplicant_8.git initial 0.8.X commit
8d520ff1dc2da35cdca849e982051b86468016d8.

Change-Id: I26aec5afbbd4f4a1f5fd900912545b6f5050de64
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
(cherry picked from commit a6df7575b64ef902ae27d17769a3cf7e6056a975)

8 years agoAndroid: Fix max number of sched scan SSIDs based on driver capability
Dmitry Shmidt [Mon, 28 Mar 2016 17:58:53 +0000 (10:58 -0700)] 
Android: Fix max number of sched scan SSIDs based on driver capability

This adds use of the driver capability (instead of hardcoded
WPAS_MAX_SCAN_SSIDS) in wpas_start_pno() similarly to what was already
done in wpa_supplicant_req_sched_scan().

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
8 years agobinder: Implement interface add/remove methods
Roshan Pius [Wed, 17 Feb 2016 00:40:06 +0000 (16:40 -0800)] 
binder: Implement interface add/remove methods

This commit implements the methods defined in Supplicant service:
1. CreateInterface
2. RemoveInterface
3. GetInterface

The binder service returns the corresponding iface binder object
references which can be used by clients to control a specific
interface.

Signed-off-by: Roshan Pius <rpius@google.com>
8 years agobinder: Add binder skeletal code for Android
Roshan Pius [Wed, 17 Feb 2016 00:39:28 +0000 (16:39 -0800)] 
binder: Add binder skeletal code for Android

Create the skeletal binder interface for wpa_supplicant. The interface
hierarchy is based off the existing dbus
interface(https://w1.fi/wpa_supplicant/devel/dbus.html).

Since we use libbinder, the binder interface codebase needs to be
written in C++ and can only be compiled on Android platform for now.

The aidl files define binder RPC interfaces. The Android build system
generates the corresponding C++ interface classes which needs to be
implemented by the server process.

The clients can obtain a reference to the binder service (root object)
using:
android::String16 service_name("fi.w1.wpa_supplicant");
android::sp<android::IBinder> binder =
  android::defaultServiceManager()->getService(service_name);

Once a reference to the root object is retrieved, the clients can
obtain references to other RPC objects using that root object methods.

Signed-off-by: Roshan Pius <rpius@google.com>
8 years agoRemove struct ieee80211_mgmt::u.probe_req
Jouni Malinen [Sat, 2 Apr 2016 13:53:04 +0000 (16:53 +0300)] 
Remove struct ieee80211_mgmt::u.probe_req

This struct in the union is empty, but the design of using a zero-length
u8 array here is not fully compatible with C++ and can result in
undesired compiler warnings. This struct is not used anymore, so it can
be removed from the struct ieee80211_mgmt definition to complete the
changes started in commit d447cd596f0a9f73850229e7fa2bdd35755dc750
('Updates for stricter automatic memcpy bounds checking').

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoatheros: Do not use struct ieee80211_mgmt::u.probe_req
Jouni Malinen [Sat, 2 Apr 2016 13:52:43 +0000 (16:52 +0300)] 
atheros: Do not use struct ieee80211_mgmt::u.probe_req

This struct in the union is empty, but the design of using a zero-length
u8 array here is not fully compatible with C++ and can result in
undesired compiler warnings. Since there are no non-IE fields in the
Probe Request frames, get the location of the variable length IEs simply
by using the pointer to the frame header and the known header length.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_supplicant: Do not use struct ieee80211_mgmt::u.probe_req
Jouni Malinen [Sat, 2 Apr 2016 13:52:02 +0000 (16:52 +0300)] 
wpa_supplicant: Do not use struct ieee80211_mgmt::u.probe_req

This struct in the union is empty, but the design of using a zero-length
u8 array here is not fully compatible with C++ and can result in
undesired compiler warnings. Since there are no non-IE fields in the
Probe Request frames, get the location of the variable length IEs simply
by using the pointer to the frame header and the known header length.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAP: Do not use struct ieee80211_mgmt::u.probe_req
Jouni Malinen [Sat, 2 Apr 2016 13:49:50 +0000 (16:49 +0300)] 
AP: Do not use struct ieee80211_mgmt::u.probe_req

This struct in the union is empty, but the design of using a zero-length
u8 array here is not fully compatible with C++ and can result in
undesired compiler warnings. Since there are no non-IE fields in the
Probe Request frames, get the location of the variable length IEs simply
by using the pointer to the frame header and the known header length.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: EAP-SIM fast reauth with no-change SET_NETWORK
Jouni Malinen [Thu, 31 Mar 2016 14:19:12 +0000 (17:19 +0300)] 
tests: EAP-SIM fast reauth with no-change SET_NETWORK

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDo not clear PMKSA entry or EAP session cache if config does not change
Bala Krishna Bhamidipati [Wed, 30 Mar 2016 15:09:39 +0000 (20:39 +0530)] 
Do not clear PMKSA entry or EAP session cache if config does not change

This avoids unnecessary flushing of the PMKSA cache entry and EAP
session data when processing SET_NETWORK commands that set a network
profile parameter to the same value that the parameter already has.

Introduce a new wpa_config_set() and wpa_config_set_quoted() return
value (==1) signifying that the new value being set for the
corresponding field equals to the already configured one so that the
caller can determine that nothing changed in the profile.

For now, this does not cover all the network profile parameters, but
number of the most commonly used parameters are included to cover the
Android use cases where the framework may have issued SET_NETWORK
commands that would have unnecessarily prevented use of PMKSA caching or
EAP fast reauthentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRevert "Assign QCA vendor command and attribute for Tx/Rx aggregation"
Sunil Dutt [Tue, 22 Mar 2016 12:46:22 +0000 (18:16 +0530)] 
Revert "Assign QCA vendor command and attribute for Tx/Rx aggregation"

This reverts commit 4ca16b5fd71833d7d200167ba10b471cab7d049f.
Configuration for this will be done using a previously assigned more
generic command. This new command
QCA_NL80211_VENDOR_SUBCMD_SET_TXRX_AGGREGATION has not been used in any
driver version and won't be used, so the assigned command id can be
freed for future use.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: SAE and bignum failures
Jouni Malinen [Sun, 27 Mar 2016 22:05:16 +0000 (01:05 +0300)] 
tests: SAE and bignum failures

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add TEST_FAIL() calls into OpenSSL bignum operations
Jouni Malinen [Sun, 27 Mar 2016 22:04:39 +0000 (01:04 +0300)] 
tests: Add TEST_FAIL() calls into OpenSSL bignum operations

This makes it easier to test error paths in bignum operations in SAE.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoComment out UDP/UNIX socket code from common ctrl_iface based on build
Jouni Malinen [Sun, 27 Mar 2016 21:17:45 +0000 (00:17 +0300)] 
Comment out UDP/UNIX socket code from common ctrl_iface based on build

These were unreachable cases in the switch statements based on how the
build was configured.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix CONFIG_CTRL_IFACE=udp6/udp6-remote builds
Jouni Malinen [Sun, 27 Mar 2016 21:14:46 +0000 (00:14 +0300)] 
Fix CONFIG_CTRL_IFACE=udp6/udp6-remote builds

wpa_supplicant_global_ctrl_iface_receive() did not handle the from
address properly for the IPv6 case. This was broken by commit
d60886cdafbf839be05ca5f7d4877565d4958a44 ('wpa_supplicant: Add monitor
support for global UDP ctrl_iface').

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: SAE and pwe failure
Jouni Malinen [Sun, 27 Mar 2016 18:45:11 +0000 (21:45 +0300)] 
tests: SAE and pwe failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSAE: Check SHA256-PRF operation result
Jouni Malinen [Sun, 27 Mar 2016 18:43:24 +0000 (21:43 +0300)] 
SAE: Check SHA256-PRF operation result

While this is mostly theoretical, check explicitly that SHA256
operations in sha256_prf*() succeed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSAE: Remove dead code in FFC pwd-value derivation
Jouni Malinen [Sun, 27 Mar 2016 18:28:45 +0000 (21:28 +0300)] 
SAE: Remove dead code in FFC pwd-value derivation

The local bits variable is set to prime_len * 8 and consequently bits %
8 cannot be anything else than 0.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: RADIUS accounting with various security cases
Jouni Malinen [Sun, 27 Mar 2016 18:26:19 +0000 (21:26 +0300)] 
tests: RADIUS accounting with various security cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Suite B error cases for PMKID and MIC derivation
Jouni Malinen [Sun, 27 Mar 2016 18:08:56 +0000 (21:08 +0300)] 
tests: Suite B error cases for PMKID and MIC derivation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WNM BSS transition management with various PHY types
Jouni Malinen [Sun, 27 Mar 2016 17:57:32 +0000 (20:57 +0300)] 
tests: WNM BSS transition management with various PHY types

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: DFS CAC functionality on channel 104 HT40-
Jouni Malinen [Sun, 27 Mar 2016 17:30:40 +0000 (20:30 +0300)] 
tests: DFS CAC functionality on channel 104 HT40-

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: AP Channel Switch - invalid channel
Jouni Malinen [Sat, 26 Mar 2016 17:41:24 +0000 (19:41 +0200)] 
tests: AP Channel Switch - invalid channel

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Information element parsing OOM
Jouni Malinen [Sat, 26 Mar 2016 17:22:44 +0000 (19:22 +0200)] 
tests: Information element parsing OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Information element parsing - extra coverage
Jouni Malinen [Sat, 26 Mar 2016 17:16:39 +0000 (19:16 +0200)] 
tests: Information element parsing - extra coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: QCA vendor element parsing
Jouni Malinen [Sat, 26 Mar 2016 17:07:49 +0000 (19:07 +0200)] 
tests: QCA vendor element parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Invalid VHT 80 and 80+80 MHz configuration (seg0/seg1)
Jouni Malinen [Sat, 26 Mar 2016 16:58:52 +0000 (18:58 +0200)] 
tests: Invalid VHT 80 and 80+80 MHz configuration (seg0/seg1)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: HT40 co-ex scan and broken legacy/HT AP
Jouni Malinen [Sat, 26 Mar 2016 15:50:50 +0000 (17:50 +0200)] 
tests: HT40 co-ex scan and broken legacy/HT AP

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: HT40 on 5 GHz with disabled secondary channel
Jouni Malinen [Sat, 26 Mar 2016 15:38:31 +0000 (17:38 +0200)] 
tests: HT40 on 5 GHz with disabled secondary channel

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix FST cleanup if alloc_fail is not supported
Jouni Malinen [Sat, 26 Mar 2016 20:51:32 +0000 (22:51 +0200)] 
tests: Fix FST cleanup if alloc_fail is not supported

The test cases fst_ap_start_session_oom and fst_setup_mbie_diff did not
clean up FST sessions properly in case alloc_fail failed due to missing
support for it in the build. This could result in abandoning attached
hostapd global control interface monitors and test case failures due to
the global control interface socket running out of output buffer.

Fix this by going through the cleanup steps even if alloc_fail raises
HwsimSkip exception.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Fix libnl-tiny build with CONFIG_LIBNL20=y
Jouni Malinen [Sat, 26 Mar 2016 10:00:34 +0000 (12:00 +0200)] 
nl80211: Fix libnl-tiny build with CONFIG_LIBNL20=y

libnl-tiny does not use the separate nl-genl library.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUse TIOCOUTQ instead of SIOCOUTQ to avoid need for linux/sockios.h
Jouni Malinen [Sat, 26 Mar 2016 09:40:35 +0000 (11:40 +0200)] 
Use TIOCOUTQ instead of SIOCOUTQ to avoid need for linux/sockios.h

All that the kernel header was doing here is defining SIOCOUTQ to be
TIOCOUTQ. Instead of pulling in the header, we might as well use
TIOCOUTQ directly.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowlantest: Use local ETH_P_IP define instead of linux/if_ether.h
Jouni Malinen [Sat, 26 Mar 2016 09:35:30 +0000 (11:35 +0200)] 
wlantest: Use local ETH_P_IP define instead of linux/if_ether.h

There is no strong need for pulling in linux/if_ether.h here since all
that is needed if ETH_P_IP and we already cover multiple other ETH_P_*
values in utils/common.h.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoDrop USE_KERNEL_HEADERS define
Jouni Malinen [Sat, 26 Mar 2016 09:29:53 +0000 (11:29 +0200)] 
Drop USE_KERNEL_HEADERS define

This was only used for providing an option to use linux/if_packet.h
instgead of netpacket/packet.h in src/ap/iapp.c. However,
netpacket/packet.h is nowadays commonly available and hostapd already
depends on it through src/l2_packet/l2_packet_linux.c, so there is no
need to continue to provide this option for the kernel header.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUse a separate header file for Linux bridge interface definitions
Jouni Malinen [Sat, 26 Mar 2016 09:27:18 +0000 (11:27 +0200)] 
Use a separate header file for Linux bridge interface definitions

This moves the BRCTL_* defines from vlan_full.c to linux_bridge.h to
clean up header inclusion.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUse own header file for defining Linux VLAN kernel interface
Jouni Malinen [Sat, 26 Mar 2016 09:19:49 +0000 (11:19 +0200)] 
Use own header file for defining Linux VLAN kernel interface

This gets rid of need to include linux/if_vlan.h and additional defines
in vlan_ioctl.c to avoid issues with missing definitions in libc
headers.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agovlan: Fix musl libc conflict with Linux kernel headers
Jörg Krause [Tue, 8 Mar 2016 20:42:30 +0000 (21:42 +0100)] 
vlan: Fix musl libc conflict with Linux kernel headers

Due to both <netinet/in.h> (in "utils/includes.h") and <linux/in6.h> (in
<linux/if_bridge.h>) being included, the in6_addr is being redefined:
once from the C library headers and once from the Linux kernel headers.
This causes some build failures with for example the musl C library:

In file included from /usr/include/linux/if_bridge.h:18,
                 from ../src/ap/vlan_init.c:17:
/usr/include/linux/in6.h:32: error: redefinition of 'struct in6_addr'
/usr/include/linux/in6.h:49: error: redefinition of 'struct sockaddr_in6'
/usr/include/linux/in6.h:59: error: redefinition of 'struct ipv6_mreq'

Mixing C library and Linux kernel headers is a bit problematic [1] and
should be avoided if possible [2]. In order to fix this, define just the
macros needed from <linux/if_bridge.h> as done in Busybox for the brctl
applet [3].

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=15850
[2] http://www.openwall.com/lists/musl/2015/10/06/1
[3] https://git.busybox.net/busybox/commit/?id=5fa6d1a632505789409a2ba6cf8e112529f9db18

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
8 years agoP2P: Fix persistent group for 60 GHz networks
Lior David [Wed, 23 Mar 2016 16:44:10 +0000 (18:44 +0200)] 
P2P: Fix persistent group for 60 GHz networks

Fix two problems with storage of 60 GHz P2P persistent groups:
1. pbss flag was not stored in the network block.
2. When recreating the persistent group from storage,
in addition to the missing pbss flag, the pairwise_cipher and
group_cipher were initialized to CCMP which does not work
in 60 GHz since the default in 60 GHz should be GCMP.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
8 years agovlan: Move if_nametoindex() use out of vlan_init.c
Jouni Malinen [Fri, 25 Mar 2016 16:00:44 +0000 (18:00 +0200)] 
vlan: Move if_nametoindex() use out of vlan_init.c

With this, vlan_init.c does not need any special header files anymore
and vlan_ifconfig.c does not need hostapd-specific header files that
might conflict with net/if.h on NetBSD.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agovlan: Move ifconfig helpers to a separate file
Jouni Malinen [Fri, 25 Mar 2016 15:56:07 +0000 (17:56 +0200)] 
vlan: Move ifconfig helpers to a separate file

This removes final ioctl() use within vlan_init.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agovlan: Move CONFIG_FULL_DYNAMIC_VLAN functionality into a separate file
Jouni Malinen [Fri, 25 Mar 2016 15:43:27 +0000 (17:43 +0200)] 
vlan: Move CONFIG_FULL_DYNAMIC_VLAN functionality into a separate file

This cleans up vlan_init.c by removing number of C pre-processor
dependencies.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agovlan: Remove unnecessary header includes from netlink implementation
Jouni Malinen [Fri, 25 Mar 2016 15:27:16 +0000 (17:27 +0200)] 
vlan: Remove unnecessary header includes from netlink implementation

The implementation in vlan_util.c does not use many of the header files
that were pulled in.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agovlan: Clean up netlink vs. ioctl API implementation
Jouni Malinen [Fri, 25 Mar 2016 15:21:41 +0000 (17:21 +0200)] 
vlan: Clean up netlink vs. ioctl API implementation

Move the ioctl-based VLAN implementation to a separate file to avoid
need for conditional blocks within vlan_ioctl.c. This removes the
internal CONFIG_VLAN_NETLINK define, i.e., this is now used only in
build configuration (.config) to select whether to include the
vlan_util.c (netlink) or vlan_ioctl.c (ioctl) implementation of the
functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agovlan: Fix musl build error
Jörg Krause [Tue, 8 Mar 2016 11:05:01 +0000 (12:05 +0100)] 
vlan: Fix musl build error

caddr_t is legacy BSD and should be avoided [1]. While glibc may still
use __caddr_t as the type, Linux kernel does not (it is "void __user *
ifru_data").

This fixes compile errors with the musl libc:

../src/ap/vlan_init.c: In function 'br_delif':
../src/ap/vlan_init.c:218:18: error: '__caddr_t' undeclared (first use in this function)
  ifr.ifr_data = (__caddr_t) args;

[1] http://stackoverflow.com/questions/6381526/what-is-the-significance-of-caddr-t-and-when-is-it-used

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
8 years agoMake it a bit easier to roam from 2.4 GHz to 5 GHz within ESS
Jouni Malinen [Fri, 25 Mar 2016 09:53:59 +0000 (11:53 +0200)] 
Make it a bit easier to roam from 2.4 GHz to 5 GHz within ESS

The initial connection to an ESS was already explicitly increasing the
likelihood of picking a 5 GHz BSS. While the throughput estimation is
likely to do same for the roaming decision, it might be possible that
that does not cover all cases. Add couple of dB extra preference for 5
GHz in case the roaming decision falls back to comparing signal levels.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix a typo in a comment
Jouni Malinen [Fri, 25 Mar 2016 09:39:31 +0000 (11:39 +0200)] 
Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WNM BSS Transition Management and cfg80211 connect command
Jouni Malinen [Thu, 24 Mar 2016 10:17:46 +0000 (12:17 +0200)] 
tests: WNM BSS Transition Management and cfg80211 connect command

For now, this is not enforcing cfg80211 reassociation since the needed
changes do not yet exist in the upstream kernel. Once those changes are
accepted, the TODO note in the test case can be addressed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WNM BSS Transition Management and security mismatch
Jouni Malinen [Thu, 24 Mar 2016 10:12:59 +0000 (12:12 +0200)] 
tests: WNM BSS Transition Management and security mismatch

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Ignore deauth/disassoc event during Connect reassociation
Jouni Malinen [Thu, 24 Mar 2016 20:33:48 +0000 (22:33 +0200)] 
nl80211: Ignore deauth/disassoc event during Connect reassociation

cfg80211 reports a deauth/disassoc event when internally clearing
connection with the previous BSS. Ignore that event to allow the new
connect command to complete.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoInclude previous BSSID in connection request to indicate reassociation
Jouni Malinen [Thu, 24 Mar 2016 10:35:05 +0000 (12:35 +0200)] 
Include previous BSSID in connection request to indicate reassociation

This allows the SME-in-the-driver case to get similar information about
reassociation that was already available for the SME-in-wpa_supplicant
case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Add NL80211_ATTR_PREV_BSSID with Connect command
Jouni Malinen [Thu, 24 Mar 2016 10:33:40 +0000 (12:33 +0200)] 
nl80211: Add NL80211_ATTR_PREV_BSSID with Connect command

This makes it easier for drivers that use the Connect command instead of
separate Auth+Assoc commands to determine when to use reassociation
instead of association. Matching changes are still needed in cfg80211 to
allow this parameter to be used, but it is safe for wpa_supplicant to
start including this attribute now since it will be ignored by older
cfg80211 versions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWNM: Verify BSS TM target match against the current network profile
Jouni Malinen [Thu, 24 Mar 2016 10:11:55 +0000 (12:11 +0200)] 
WNM: Verify BSS TM target match against the current network profile

Reject a BSS transition management candidate if it does not match the
current network profile, e.g., due to incompatible security parameters.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agomesh: Simplify wpa_auth_pmksa_set_to_sm()
Jouni Malinen [Tue, 22 Mar 2016 18:37:46 +0000 (20:37 +0200)] 
mesh: Simplify wpa_auth_pmksa_set_to_sm()

pmksa->pmk or pmksa->pmkid cannot be NULL since they are arrays. Remove
the unnecessary NULL checks and use the provided pmksa pointer directly
to simplify the implementation. (CID 138519)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoprivsep: Fix a compiler warning on unsigned/signed comparison
Jouni Malinen [Tue, 22 Mar 2016 09:31:30 +0000 (11:31 +0200)] 
privsep: Fix a compiler warning on unsigned/signed comparison

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd interface matching support with -M, guarded by CONFIG_MATCH_IFACE
Roy Marples [Tue, 15 Mar 2016 13:40:14 +0000 (13:40 +0000)] 
Add interface matching support with -M, guarded by CONFIG_MATCH_IFACE

The new wpa_supplicant command line argument -M can be used to describe
matching rules with a wildcard interface name (e.g., "wlan*").

This is very useful for systems without udev (Linux) or devd (FreeBSD).

Signed-off-by: Roy Marples <roy@marples.name>
8 years agoFind correct driver for interface additions/removals
Roy Marples [Tue, 15 Mar 2016 13:02:08 +0000 (13:02 +0000)] 
Find correct driver for interface additions/removals

Interface additions/removals are not guaranteed to be for the driver
listening to the kernel events. As such, send the events to
wpa_supplicant_event_global() which can then pick the correct interface
registered with wpa_supplicant to send the event to.

Signed-off-by: Roy Marples <roy@marples.name>
8 years agowpa_supplicant: Fix CONFIG_IBSS_RSN=y build without CONFIG_AP=y
Jouni Malinen [Mon, 21 Mar 2016 19:09:03 +0000 (21:09 +0200)] 
wpa_supplicant: Fix CONFIG_IBSS_RSN=y build without CONFIG_AP=y

Commit 1889af2e0f89f9a98171761683eb1c244584daf8 ('VLAN: Separate station
grouping and uplink configuration') added an ap_sta_set_vlan() function
that gets called from pmksa_cache_auth.c. This broke CONFIG_IBSS_RSN=y
build if src/ap/sta_info.c did not get included in the build, i.e., if
CONFIG_AP=y was not set.

Fix this by making the ap_sta_set_vlan() call conditional on
CONFIG_NO_VLAN being undefined and define this for CONFIG_IBSS_RSN=y
builds. This is fine for wpa_supplicant since CONFIG_AP=y case was
already defining this. For hostapd, this function call is not needed for
CONFIG_NO_VLAN case either.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Allow RC4-SHA failure in ap_wpa2_eap_fast_cipher_suites
Jouni Malinen [Mon, 21 Mar 2016 11:12:10 +0000 (13:12 +0200)] 
tests: Allow RC4-SHA failure in ap_wpa2_eap_fast_cipher_suites

This needs to be allowed with OpenSSL 1.1.0 since the RC4-based cipher
has been disabled by default.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Improve debug logs in hostapd/wpasupplicant with remote commands
Janusz Dziedzic [Tue, 8 Mar 2016 13:28:05 +0000 (14:28 +0100)] 
tests: Improve debug logs in hostapd/wpasupplicant with remote commands

Show more info when we are using remote wpaspy and UDP-based control
interface.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
8 years agotests: hostapd.py/wpasupplicant.py use Host when executing commands
Janusz Dziedzic [Tue, 8 Mar 2016 13:28:04 +0000 (14:28 +0100)] 
tests: hostapd.py/wpasupplicant.py use Host when executing commands

Execute commands using the Host class. This enables use of remote hosts
as well.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
8 years agotests: Add remotehost.py and Host class
Janusz Dziedzic [Tue, 8 Mar 2016 13:28:03 +0000 (14:28 +0100)] 
tests: Add remotehost.py and Host class

This class allows execution of commands on a remote hosts/machine. This
is based on ssh with authorized keys, so you should be able to execute
such commands without any password:

ssh <user>@<hostname> id

By default user is root.

Support for sync and async calls is included.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
8 years agowpa_supplicant: Fix p2p_group_add when UDP-based ctrl_iface is used
Janusz Dziedzic [Tue, 8 Mar 2016 13:28:02 +0000 (14:28 +0100)] 
wpa_supplicant: Fix p2p_group_add when UDP-based ctrl_iface is used

While p2p_group_add ctrl_interface name could be derived from the main
interface (simple p2p_group_add command), we failed to bind the same UDP
port. Fix this problem and also update the correct ctrl_interface name
(port decrement).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
8 years agoFST: Fix a compiler warning
Jouni Malinen [Sun, 20 Mar 2016 19:37:12 +0000 (21:37 +0200)] 
FST: Fix a compiler warning

FST_MAX_PRIO_VALUE is unsigned (u32) and some gcc versions warning about
comparisong to long int val at least on 32-bit builds. Get rid of this
warning by type casesing val to unsigned long int after having verified
that it is positive.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix nfc_pw_token build with CONFIG_FST=y
Jouni Malinen [Sun, 20 Mar 2016 18:18:55 +0000 (20:18 +0200)] 
Fix nfc_pw_token build with CONFIG_FST=y

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add CONFIG_VLAN_NETLINK=y to hostapd build configuration
Jouni Malinen [Sun, 20 Mar 2016 17:54:57 +0000 (19:54 +0200)] 
tests: Add CONFIG_VLAN_NETLINK=y to hostapd build configuration

This is needed for ap_vlan_tagged_wpa2_radius_id_change to pass. The
ioctl-based vlan_add() function does not use the vlan_if_name parameter
at all.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Use appropriate BLOCKED state duration
Masashi Honma [Fri, 11 Mar 2016 08:37:25 +0000 (17:37 +0900)] 
mesh: Use appropriate BLOCKED state duration

Previously, BLOCKED state duration slightly increased up to 3600. Though
the BLOCKED state could be canceled by ap_handle_timer(). Because the
timer timeouts in ap_max_inactivity(default=300sec) and remove STA
objects (the object retains BLOCKED state).

This patch re-designs my commit bf51f4f82bdb50356de5501acac53fe1b91a7b86
('mesh: Fix remaining BLOCKED state after SAE auth failure') to replace
mesh_auth_block_duration by ap_max_inactivity and remove incremental
duration.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agotests: Secure mesh network and PMKSA caching
Jouni Malinen [Sun, 20 Mar 2016 16:24:10 +0000 (18:24 +0200)] 
tests: Secure mesh network and PMKSA caching

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: PMKSA cache control interface operations
Jouni Malinen [Sun, 20 Mar 2016 16:06:03 +0000 (18:06 +0200)] 
tests: PMKSA cache control interface operations

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Add support for PMKSA caching
Masashi Honma [Wed, 9 Mar 2016 09:16:14 +0000 (18:16 +0900)] 
mesh: Add support for PMKSA caching

This patch add functionality of mesh SAE PMKSA caching. If the local STA
already has peer's PMKSA entry in the cache, skip SAE authentication and
start AMPE with the cached value.

If the peer does not support PMKSA caching or does not have the local
STA's PMKSA entry in the cache, AMPE will fail and the PMKSA cache entry
of the peer will be removed. Then STA retries with ordinary SAE
authentication.

If the peer does not support PMKSA caching and the local STA uses
no_auto_peer=1, the local STA can not retry SAE authentication because
NEW_PEER_CANDIDATE event cannot start SAE authentication when
no_auto_peer=1. So this patch extends MESH_PEER_ADD command to use
duration(sec). Throughout the duration, the local STA can start SAE
authentication triggered by NEW_PEER_CANDIDATE even though
no_auto_peer=1.

This commit requires commit 70c93963edefa37ef84b73efb9d04ea10268341c
('SAE: Fix PMKID calculation for PMKSA cache'). Without that commit,
chosen PMK comparison will fail.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoPMKSA: Flush AP/mesh PMKSA cache by PMKSA_FLUSH command
Masashi Honma [Wed, 9 Mar 2016 09:16:13 +0000 (18:16 +0900)] 
PMKSA: Flush AP/mesh PMKSA cache by PMKSA_FLUSH command

This extends the wpa_supplicant PMKSA_FLUSH control interface command to
allow the PMKSA list from the authenticator side to be flushed for AP
and mesh mode. In addition, this adds a hostapd PMKSA_FLUSH control
interface command to flush the PMKSA entries.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoPMKSA: Show AP/mesh PMKSA list in PMKSA command
Masashi Honma [Wed, 9 Mar 2016 09:16:12 +0000 (18:16 +0900)] 
PMKSA: Show AP/mesh PMKSA list in PMKSA command

This extends the wpa_supplicant PMKSA control interface command to allow
the PMKSA list from the authenticator side to be listed for AP and mesh
mode. In addition, this adds a hostapd PMKSA control interface command
to show the same list for the AP case.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agomesh: Add MESH_PEER_ADD command
Masashi Honma [Wed, 9 Mar 2016 09:16:11 +0000 (18:16 +0900)] 
mesh: Add MESH_PEER_ADD command

This allows a mesh peer connection to be initiated manually in
no_auto_peer mesh networks.

Signed-off-by: Natsuki Itaya <Natsuki.Itaya@jp.sony.com>
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agomesh: Add MESH_PEER_REMOVE command
Masashi Honma [Wed, 9 Mar 2016 09:16:10 +0000 (18:16 +0900)] 
mesh: Add MESH_PEER_REMOVE command

This command allows the specified mesh peer to be disconnected.

Signed-off-by: Natsuki Itaya <Natsuki.Itaya@jp.sony.com>
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoP2P: Advertise IP Address Allocation only if it is enabled on GO
Jouni Malinen [Sun, 20 Mar 2016 09:46:04 +0000 (11:46 +0200)] 
P2P: Advertise IP Address Allocation only if it is enabled on GO

This group capability bit was previously added unconditionally which
could result in the P2P Client assuming the functionality is available
even though the GO would always reject the request (not reply to it with
an assigned IP address) during the 4-way handshake.

Fix this by advertising the capability only if the GO configuration
allow IP address assignment to be completed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoBSD: Only down the interface once we are sure we can work with it
Roy Marples [Tue, 15 Mar 2016 10:39:24 +0000 (10:39 +0000)] 
BSD: Only down the interface once we are sure we can work with it

Signed-off-by: Roy Marples <roy@marples.name>
8 years agoHandle OSEN IE in Assoc Request info if req_ies exists
Daisuke Niwa [Wed, 16 Mar 2016 06:01:59 +0000 (15:01 +0900)] 
Handle OSEN IE in Assoc Request info if req_ies exists

The 4-way handshake fails with the error "WPA: No wpa_ie set - cannot
generate msg 2/4" while connecting to OSEN network with drivers that
indicate used Association Request frame elements because OSEN IE is not
handled in wpa_supplicant_event_associnfo() if data->assoc_info.req_ies
is not NULL.

Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
8 years agotests: Return result from WpaSupplicant::global_request() in all cases
Jouni Malinen [Sun, 20 Mar 2016 09:08:12 +0000 (11:08 +0200)] 
tests: Return result from WpaSupplicant::global_request() in all cases

The no self.global_iface case was not returning the result from the
self.request() case. While this is not really a path that is supposed to
be used, make it return the response since it is at least theoretically
possible to get here.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Fix error path in if_indices_reason reallocation
Jouni Malinen [Fri, 18 Mar 2016 14:25:35 +0000 (16:25 +0200)] 
nl80211: Fix error path in if_indices_reason reallocation

Commit 732b1d20ec06ab92fd22dbdea4609a6528bcf50a ('nl80211: Clean up
ifidx properly if interface in a bridge is removed') added
drv->if_indices_reason array similarly to the previously used
drv->if_indices. However, it had a copy-paste error here on the error
path where a reallocation failure after at least one successful
reallocation would result in the drv->if_indices being overridden
instead of restoring drv->if_indices_reason to the old value. Fix this
by setting the correct variable on the error path. (CID 138514)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant AP mode - open network and HT disabled
Jouni Malinen [Fri, 18 Mar 2016 14:18:32 +0000 (16:18 +0200)] 
tests: wpa_supplicant AP mode - open network and HT disabled

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Do not add NL80211_ATTR_SMPS_MODE attribute if HT is disabled
Jouni Malinen [Fri, 18 Mar 2016 14:16:40 +0000 (16:16 +0200)] 
nl80211: Do not add NL80211_ATTR_SMPS_MODE attribute if HT is disabled

SMPS mode is applicable only for HT and including an attribute to
configure it when HT is disabled could result in the AP start operation
failing. Fix this by adding the attribute only in cases where HT is
enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAssign QCA vendor command and attribute for Tx/Rx aggregation
Sunil Dutt [Thu, 17 Mar 2016 14:43:11 +0000 (20:13 +0530)] 
Assign QCA vendor command and attribute for Tx/Rx aggregation

Assign nl80211 vendor command
QCA_NL80211_VENDOR_SUBCMD_SET_TXRX_AGGREGATION and corresponding
attributes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agolibxml2: Check for xmlDocDumpFormatMemory() error case
Jouni Malinen [Wed, 16 Mar 2016 19:49:28 +0000 (21:49 +0200)] 
libxml2: Check for xmlDocDumpFormatMemory() error case

Since this function needs to allocate memory, it might fail. Check that
the returned memory pointer is not NULL before trying to parse the
output.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoBoringSSL: Keep static analyzers happier with X509_get0_pubkey_bitstr()
Jouni Malinen [Wed, 16 Mar 2016 19:34:01 +0000 (21:34 +0200)] 
BoringSSL: Keep static analyzers happier with X509_get0_pubkey_bitstr()

While this function could return NULL if the parameter issued to it were
NULL, that does not really happen here. Anyway, since this can result in
a warning from a static analyzer that does can see the return NULL
without fully understanding what it means here, check the return value
explicitly against NULL to avoid false warnings.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohs20-osu-client: Fix pol_upd command line parsing
Jouni Malinen [Wed, 16 Mar 2016 19:25:11 +0000 (21:25 +0200)] 
hs20-osu-client: Fix pol_upd command line parsing

This command was documented as having the Server URL parameter as
optional, but the implementation did not match that. Allow this
parameter to be left out.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohs20-osu-client: Remove dead code from sub_rem command line parsing
Jouni Malinen [Wed, 16 Mar 2016 19:19:19 +0000 (21:19 +0200)] 
hs20-osu-client: Remove dead code from sub_rem command line parsing

The error print could not have been reached since the exact same
condition was verified above and exit(0) is called if the command line
is invalid.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: EAP-SIM and check fast reauth with bssid change
Jouni Malinen [Wed, 16 Mar 2016 17:46:27 +0000 (19:46 +0200)] 
tests: EAP-SIM and check fast reauth with bssid change

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDo not invalidate EAP session cache on all network block parameter changes
Jouni Malinen [Wed, 16 Mar 2016 17:44:32 +0000 (19:44 +0200)] 
Do not invalidate EAP session cache on all network block parameter changes

The bssid and priority parameters in a network block do not have any
effect on the validity of an EAP session entry, so avoid flushing the
cached session when only these parameters are changed. This is mainly to
allow forced roaming or network selection changes without causing fast
reauthentication to be disabled if the changes are done during RSN
association that used EAP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowlantest: Fix bip_protect() memory allocation
Jouni Malinen [Mon, 14 Mar 2016 16:42:46 +0000 (18:42 +0200)] 
wlantest: Fix bip_protect() memory allocation

The addition operator is of higher precedence than the ternary
conditional and the construction here needs to use parentheses to
calculate the buffer length properly when generating test frames with
BIP protection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoInterworking: Add credential realm to EAP-TLS identity
Jouni Malinen [Fri, 11 Mar 2016 18:18:51 +0000 (20:18 +0200)] 
Interworking: Add credential realm to EAP-TLS identity

If the configured credential includes a username without '@' (i.e., no
realm) in it and a realm, combine these to form the EAP-Request/Identity
value as "<username>@<realm>" for EAP-TLS. This was already done for
EAP-TTLS as part of the anonymous NAI conversion, but EAP-TLS could have
ended up using a username without any realm information which would be
unlikely to work properly with roaming cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Accept "user@example.com" as user identity similarly to "user"
Jouni Malinen [Fri, 11 Mar 2016 19:05:25 +0000 (21:05 +0200)] 
tests: Accept "user@example.com" as user identity similarly to "user"

This is needed to allow updated Interworking behavior that adds the
realm to the EAP-Response/Identity value.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Support network hierarchy of a master interface under bridge
Dedy Lansky [Sun, 28 Feb 2016 13:54:17 +0000 (15:54 +0200)] 
nl80211: Support network hierarchy of a master interface under bridge

Since commit cb05808c46539922cf02e9e8527a062e90637ff9 ('nl80211: Generic
Linux master interface support for hostapd'), hostapd is listening for
EAPOL frames on any master which the interface is enslaved under.

This commit allows hostapd to support network hierarchy in which the
interface is enslaved under some master which in turn is enslaved under
a bridge.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
8 years agotests: Set ocsp_stapling_response_multi in as2.conf
Jouni Malinen [Wed, 9 Mar 2016 17:39:15 +0000 (19:39 +0200)] 
tests: Set ocsp_stapling_response_multi in as2.conf

This keeps the as.conf and as2.conf more consistent.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Fix root_ocsp() for multi-OCSP test cases
Jouni Malinen [Wed, 9 Mar 2016 17:38:26 +0000 (19:38 +0200)] 
tests: Fix root_ocsp() for multi-OCSP test cases

Incorrect path and file name was used in the openssl command to generate
one of the OCSP responses. Also fix
ap_wpa2_eap_tls_intermediate_ca_ocsp_multi to expect success rather than
failure due to OCSP response. Based on the test description, this was
supposed to succeed, but apparently that root_ocsp() bug prevented this
from happening.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoReserve QCA vendor specific nl80211 commands 116..118
Jouni Malinen [Tue, 8 Mar 2016 21:08:45 +0000 (23:08 +0200)] 
Reserve QCA vendor specific nl80211 commands 116..118

These are reserved for QCA use.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Handle running out of DFS channels
Zefir Kurtisi [Mon, 7 Mar 2016 11:47:01 +0000 (12:47 +0100)] 
hostapd: Handle running out of DFS channels

In scenarios where only DFS channels are available (e.g., outdoor,
special country codes), hostapd must be able to handle situations
where all are unavailable.

The two possibilities to get there are
1) while operating on the last available DFS channel a radar is
   detected
2) hostapd is started while all channels are unavailable

In both cases, hostapd instead of terminating should better
wait for the NOPs to pass and re-try operation after the CAC.

This patch provides that feature by using the condition
(iface->state == HAPD_IFACE_DFS && !iface->cac_started)
as NOP mode signature to retry operation from within
hostapd_dfs_nop_finished().

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
8 years agoFST: Fix session setup failure with peer without MB IE
Dedy Lansky [Mon, 7 Mar 2016 13:22:54 +0000 (15:22 +0200)] 
FST: Fix session setup failure with peer without MB IE

Upon receiving FST setup request on old band, the peer is searched on
new band. The assumption is that MB IE from this peer on new band
previously received either in assoc event or in FST setup request.

There are cases in which above assumption doesn't work, peer is not
found and session setup fails. For example:
- STA connects over 11ac. Due to driver limitation, MB IE is not included
in assoc event
- STA connects over 11ad. MB IE included in assoc event.
- FST session established on 11ac band, with AP as initiator. i.e. FST
setup request sent in AP=>STA direction. STA searches for peer's (AP)
MB IE on 11ad band which exists.
- FST switch occur
- FST session established on 11ad band, with STA as initiator. i.e. FST
setup request sent in STA=>AP direction. AP searches for peer's (STA)
MB IE on 11ac band which are absent.

For fixing the above, consider also peers without MB IE as candidates in
the search algorithm.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
8 years agoP2P: Add optional op_class argument to P2P_SET listen_channel
Lior David [Thu, 18 Feb 2016 13:20:03 +0000 (15:20 +0200)] 
P2P: Add optional op_class argument to P2P_SET listen_channel

The existing implementation in p2p_ctrl_set used a hard-coded operating
class 81 which is only suitable for the social channels in the 2.4 GHz
band, and will not work for the social channel in the 60 GHz band.
Extend this by adding an optional op_class argument to P2P_SET
listen_channel. If not specified, use the default value of 81 to match
existing behavior.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>