qcacmn: Define VENDOR_NLA_POLICY_MAC_ADDR for mac addresses
Strict NLA validation is introduced from kernel version 4.20 where NLA_UNSPEC usage is restricted. A new attibute type NLA_POLICY_ETH_ADDR is introduced for MAC address. Define a macro to use this if the kernel version is greater than 4.19. Also define NLA_EXACT_LEN as NLA_UNSPEC for kernels less than 4.20. Change-Id: I9d9bee7a12d84ca81b5777ccb417a33f08949203 CRs-Fixed: 2701357
This commit is contained in:

committed by
nshrivas

parent
803403f264
commit
3e3a071188
@@ -70,6 +70,15 @@
|
||||
#define VENDOR_NLA_POLICY_NESTED(__policy) {.type = NLA_NESTED}
|
||||
#endif /*End of (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) */
|
||||
|
||||
/* For kernel version <= 4.20, driver needs to provide policy */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
#define VENDOR_NLA_POLICY_MAC_ADDR NLA_POLICY_ETH_ADDR
|
||||
#else
|
||||
#define VENDOR_NLA_POLICY_MAC_ADDR \
|
||||
{.type = NLA_UNSPEC, .len = QDF_MAC_ADDR_SIZE}
|
||||
#define NLA_EXACT_LEN NLA_UNSPEC
|
||||
#endif /*End of (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 20, 0) */
|
||||
|
||||
#if defined(NBUF_MEMORY_DEBUG) && defined(NETLINK_BUF_TRACK)
|
||||
#define wlan_cfg80211_vendor_free_skb(skb) \
|
||||
qdf_nbuf_free(skb)
|
||||
|
Reference in New Issue
Block a user