nl80211: allow phy names that don't start with 'phy'
authorFelix Fietkau <nbd@nbd.name>
Thu, 22 Sep 2022 11:28:57 +0000 (13:28 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 Sep 2022 11:28:59 +0000 (13:28 +0200)
This is needed for dealing with wiphy renaming

Signed-off-by: Felix Fietkau <nbd@nbd.name>
iwinfo_nl80211.c

index d7fbd1e36c50ef98f8e4c4a108b51c3a6383c3a1..15831c95087d70e50667ba59bb5191c77875bb5f 100644 (file)
@@ -245,9 +245,6 @@ static const char *nl80211_phy_path_str(const char *phyname)
        int seq = 0;
        DIR *d;
 
-       if (strncmp(phyname, "phy", 3) != 0)
-               return NULL;
-
        phy_id = atoi(phyname + 3);
        buf_len = snprintf(buf, sizeof(buf), "/sys/class/ieee80211/%s/device", phyname);
        link = realpath(buf, path);
@@ -3526,9 +3523,6 @@ static int nl80211_lookup_phyname(const char *section, char *buf)
 
 static int nl80211_phy_path(const char *phyname, const char **path)
 {
-       if (strncmp(phyname, "phy", 3) != 0)
-               return -1;
-
        if (strchr(phyname, '/'))
                return -1;