vmnet: fix wireless device detection

Mainline commit c304eddcecfe ("net: wrap the wireless pointers in struct
net_device in an ifdef") in 5.19-rc1 makess ieee80211_ptr member present in
struct net_device only if CONFIG_CFG80211 is enabled. Do the same for the
code testing its value in VNetBridgeIsDeviceWireless() to fix build against
kernel with CONFIG_CFG80211 disabled. Functionally, this is equivalent to
newly introduced wireless_group_needed() helper in upstream kernel code.

We can use the same code also for older kernels as with CONFIG_CFG80211
disabled, the pointer should be null anyway.
This commit is contained in:
Michal Kubecek 2022-06-07 21:29:28 +02:00
parent 6e536a375e
commit a069c3055e
1 changed files with 7 additions and 3 deletions

View File

@ -809,10 +809,14 @@ static Bool
VNetBridgeIsDeviceWireless(struct net_device *dev) //IN: sock
{
#if defined(CONFIG_WIRELESS_EXT)
return dev->ieee80211_ptr != NULL || dev->wireless_handlers != NULL;
#else
return dev->ieee80211_ptr != NULL;
if (dev->wireless_handlers)
return true;
#endif
#if IS_ENABLED(CONFIG_CFG80211)
if (dev->ieee80211_ptr)
return true;
#endif
return false;
}