Skip to content

Modify indexing for function vwifi_interface_add #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions vwifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ static void vwifi_virtio_scan_complete(struct timer_list *t);
* interfaces. The interface mode is set to STA mode. To change the interface
* type, use the change_virtual_intf() function.
*/
static struct wireless_dev *vwifi_interface_add(struct wiphy *wiphy, int if_idx)
static struct wireless_dev *vwifi_interface_add(struct wiphy *wiphy)
{
struct net_device *ndev = NULL;
struct vwifi_vif *vif = NULL;
Expand Down Expand Up @@ -1323,7 +1323,8 @@ static struct wireless_dev *vwifi_interface_add(struct wiphy *wiphy, int if_idx)
* address (the first byte of multicast addrs is odd).
*/
char intf_name[ETH_ALEN] = {0};
snprintf(intf_name + 1, ETH_ALEN - 1, "%s%d", NAME_PREFIX, if_idx);
snprintf(intf_name + 1, ETH_ALEN - 1, "%s%d", NAME_PREFIX,
atomic_read(&vwifi_wiphy_counter));

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
eth_hw_addr_set(vif->ndev, intf_name);
Expand Down Expand Up @@ -2982,7 +2983,7 @@ static int __init vwifi_init(void)
struct wiphy *wiphy = vwifi_cfg80211_add();
if (!wiphy)
goto cfg80211_add;
if (!vwifi_interface_add(wiphy, i))
if (!vwifi_interface_add(wiphy))
goto interface_add;
}

Expand Down