thom311 / libnl

Netlink Library Suite
GNU Lesser General Public License v2.1
423 stars 311 forks source link

No cache support for genl #298

Open jeffisaavs opened 3 years ago

jeffisaavs commented 3 years ago

Many userspace applications (iw, wpa_supplicant, etc.) use netlink to interact with wireless drivers. However, the NETLINK_GENERIC protocol has no out-of-the-box caching mechanism.

I've noticed that messages received over netlink from iwlwifi are occasionally missing information. For instance, the response after issuing NL80211_CMD_GET_INTERFACE is occasionally missing fields in the NL80211_STA_INFO_TX_BITRATE nested attribute. This results in wpa_supplicant and iw reporting the incorrect MCS and link speed.

Is it possible to implement caching in genl? It seems like the first thing that would have to be done would be defining nl_cache_ops, but beyond that, I'm not sure how complicated the implementation would be.

chengyechun commented 2 years ago

hello,l don't understand,what do your mean, Is to define nl_cache_ops in genl as in libnl/cache.c or addition of nl_cache_ops? what fields do you want to caching.

jeffisaavs commented 2 years ago

I've observed that NL80211_STA_INFO_TX_BITRATE occasionally has null fields when I issue the NL80211_CMD_GET_INTERFACE command. I don't know the cause of this problem. But I do know that applications like iw and wpa_supplicant never expect a null value back from the driver. Is the correct way to fix this to implement nl_cache_ops for the nl80211?