commit b8ef64f6e3dde5caedb49727ad71235797c3bfd0
parent 7a2719f3140cb7e94b8e2c690db04a31ed9d363c
Author: Denis Kenzior <denkenz@gmail.com>
Date: Mon, 19 Apr 2021 16:31:42 -0500
frame-xchg: iftype changes to be managed by netdev
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.
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/frame-xchg.c b/src/frame-xchg.c
@@ -1313,7 +1313,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();
@@ -1322,11 +1321,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
@@ -4877,8 +4877,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;
@@ -4889,6 +4891,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)