--- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -165,11 +165,15 @@ int cfg80211_switch_netns(struct cfg8021 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { if (!wdev->netdev) continue; +#if LINUX_VERSION_IS_GEQ(6,12,0) wdev->netdev->netns_local = false; +#endif err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); if (err) break; +#if LINUX_VERSION_IS_GEQ(6,12,0) wdev->netdev->netns_local = true; +#endif } if (err) { @@ -181,11 +185,15 @@ int cfg80211_switch_netns(struct cfg8021 list) { if (!wdev->netdev) continue; +#if LINUX_VERSION_IS_GEQ(6,12,0) wdev->netdev->netns_local = false; +#endif err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); WARN_ON(err); +#if LINUX_VERSION_IS_GEQ(6,12,0) wdev->netdev->netns_local = true; +#endif } return err; @@ -1525,7 +1533,9 @@ static int cfg80211_netdev_notifier_call SET_NETDEV_DEVTYPE(dev, &wiphy_type); wdev->netdev = dev; /* can only change netns with wiphy */ +#if LINUX_VERSION_IS_GEQ(6,12,0) dev->netns_local = true; +#endif cfg80211_init_wdev(wdev); break;