From: Felix Fietkau Date: Thu, 22 Sep 2022 11:28:57 +0000 (+0200) Subject: nl80211: allow phy names that don't start with 'phy' X-Git-Url: http://git.openwrt.org/?p=project%2Fiwinfo.git;a=commitdiff_plain;h=1f695d9c7f823ff8bd7a65138d98da8dfcb1cc24 nl80211: allow phy names that don't start with 'phy' This is needed for dealing with wiphy renaming Signed-off-by: Felix Fietkau --- diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index d7fbd1e..15831c9 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -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;