From 4e96dbd7f7fefed3a7a79e7cabc0c3c08bd5623a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 24 Oct 2021 17:35:15 +0200 Subject: [PATCH 1/3] =?UTF-8?q?network:=20don=E2=80=99t=20send=20nl80211?= =?UTF-8?q?=20request=20if=20we=20don=E2=80=99t=20have=20a=20family-id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue where we sometimes failed to retrieve the SSID; we sent one initial request before the family ID had been set. Then, we received the family ID and tried to send another request. However, if the first request was still in progress, the second request was never made. Since the first request lacked the family ID, that response didn’t contain anything useful. --- modules/network.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/network.c b/modules/network.c index bf32c57..117f687 100644 --- a/modules/network.c +++ b/modules/network.c @@ -310,6 +310,9 @@ send_nl80211_request(struct private *m, uint8_t cmd, uint16_t flags, uint32_t se if (m->ifindex < 0) return false; + if (m->nl80211.family_id == (uint16_t)-1) + return false; + const struct { struct nlmsghdr hdr; struct { From 9ffd305b594cf4767da3af8d33da9e02efb67b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 24 Oct 2021 17:47:54 +0200 Subject: [PATCH 2/3] network: must re-send station request when we receive family ID The get station request also fails if the family ID is invalid. --- modules/network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/network.c b/modules/network.c index 117f687..06ada9b 100644 --- a/modules/network.c +++ b/modules/network.c @@ -695,6 +695,7 @@ handle_genl_ctrl(struct module *mod, uint16_t type, bool nested, case CTRL_ATTR_FAMILY_ID: { m->nl80211.family_id = *(const uint16_t *)payload; send_nl80211_get_interface(m); + send_nl80211_get_station(m); break; } From 31f160141e0250e3b4c090e6a33d5a53cd85c5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 24 Oct 2021 17:50:10 +0200 Subject: [PATCH 3/3] changelog: network: failure to retrieve wireless attributes --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6990b6b..84f80e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ * foreign-toplevel: update bar when a top-level is closed. * Bar not being mapped on an output before at least one module has “refreshed” it (https://codeberg.org/dnkl/yambar/issues/116). +* network: failure to retrieve wireless attributes (SSID, RX/TX + bitrate, signal strength etc). ### Security