Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 2/8] frame-xchg: iftype changes to be managed by netdev
Date: Tue, 20 Apr 2021 11:35:13 -0500	[thread overview]
Message-ID: <20210420163519.12375-2-denkenz@gmail.com> (raw)
In-Reply-To: <20210420163519.12375-1-denkenz@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1952 bytes --]

Since netdev now keeps track of iftype changes, let it call
frame_watch_wdev_remove on netdevs that it manages to clear frame
registrations that should be cleared due to an iftype change.

Note that P2P_DEVICE wdevs are not managed by any netdev object, but
since their iftype cannot be changed, they should not be affected
by this change.
---
 src/frame-xchg.c | 7 +------
 src/netdev.c     | 3 +++
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/frame-xchg.c b/src/frame-xchg.c
index e01747326fc5..85f55f2bf941 100644
--- a/src/frame-xchg.c
+++ b/src/frame-xchg.c
@@ -1312,7 +1312,6 @@ static void frame_xchg_config_notify(struct l_genl_msg *msg, void *user_data)
 		if (!wdev) {
 			wdev = l_new(struct wdev_info, 1);
 			wdev->id = wdev_id;
-			wdev->iftype = iftype;
 
 			if (!wdevs)
 				wdevs = l_queue_new();
@@ -1321,11 +1320,7 @@ static void frame_xchg_config_notify(struct l_genl_msg *msg, void *user_data)
 			break;
 		}
 
-		if (wdev->iftype != iftype) {
-			wdev->iftype = iftype;
-			frame_watch_wdev_remove(wdev_id);
-		}
-
+		wdev->iftype = iftype;
 		break;
 
 	case NL80211_CMD_DEL_INTERFACE:
diff --git a/src/netdev.c b/src/netdev.c
index 05e22148e495..f4877bbd6fbb 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -4871,8 +4871,10 @@ static void netdev_set_interface_event(struct l_genl_msg *msg,
 							struct netdev *netdev)
 {
 	uint32_t iftype;
+	uint64_t wdev_id;
 
 	if (nl80211_parse_attrs(msg, NL80211_ATTR_IFTYPE, &iftype,
+					NL80211_ATTR_WDEV, &wdev_id,
 					NL80211_ATTR_UNSPEC) < 0)
 		return;
 
@@ -4883,6 +4885,7 @@ static void netdev_set_interface_event(struct l_genl_msg *msg,
 			netdev_iftype_to_string(netdev->type),
 			netdev_iftype_to_string(iftype));
 	netdev->type = iftype;
+	frame_watch_wdev_remove(wdev_id);
 
 	/* Set RSSI threshold for CQM notifications */
 	if (netdev->type == NL80211_IFTYPE_STATION)
-- 
2.26.3

  reply	other threads:[~2021-04-20 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 16:35 [PATCH 1/8] netdev: Track SET_INTERFACE events Denis Kenzior
2021-04-20 16:35 ` Denis Kenzior [this message]
2021-04-20 16:35 ` [PATCH 3/8] netdev: Re-add frame watches on iftype change Denis Kenzior
2021-04-20 16:35 ` [PATCH 4/8] rrm: Track that station is removed Denis Kenzior
2021-04-20 16:35 ` [PATCH 5/8] netdev: Add new iftype change event Denis Kenzior
2021-04-20 16:35 ` [PATCH 6/8] rrm: Always create RRM state Denis Kenzior
2021-04-20 16:35 ` [PATCH 7/8] rrm: React to IFTYPE_CHANGE events Denis Kenzior
2021-04-20 16:35 ` [PATCH 8/8] station: Move AP directed roam watch to station Denis Kenzior
2021-04-23 14:52 ` [PATCH 1/8] netdev: Track SET_INTERFACE events Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210420163519.12375-2-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox