This is to support key deletion for mesh interface, especially
to be used for key which is not deleted even with the deletion
of peer mesh station.
Signed-off-by: Chun-Yeow Yeoh <[email protected]>
---
net/mac80211/cfg.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 64cf294..6ff3414 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -239,7 +239,10 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
if (mac_addr) {
ret = -ENOENT;
- sta = sta_info_get_bss(sdata, mac_addr);
+ if (ieee80211_vif_is_mesh(&sdata->vif))
+ sta = sta_info_get(sdata, mac_addr);
+ else
+ sta = sta_info_get_bss(sdata, mac_addr);
if (!sta)
goto out_unlock;
--
1.7.0.4
On Tue, 2013-06-18 at 12:07 +0800, Chun-Yeow Yeoh wrote:
> This is to support key deletion for mesh interface, especially
> to be used for key which is not deleted even with the deletion
> of peer mesh station.
Can you explain which keys in mesh aren't deleted? It seems the
per-station keys would be deleted when the station is deleted, and
something like "GTK" would be deleted when leaving the mesh?
johannes
On Tue, 2013-06-18 at 12:07 +0800, Chun-Yeow Yeoh wrote:
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -239,7 +239,10 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
> if (mac_addr) {
> ret = -ENOENT;
>
> - sta = sta_info_get_bss(sdata, mac_addr);
> + if (ieee80211_vif_is_mesh(&sdata->vif))
> + sta = sta_info_get(sdata, mac_addr);
> + else
> + sta = sta_info_get_bss(sdata, mac_addr);
I don't see that this actually changes anything. The mesh sdata will
have a NULL bss pointer, so the second condition in sta_info_get_bss()
can't be true.
Therefore, only the first condition can ever be considered, which is
exactly the same as sta_info_get(), no?
johannes
> I don't see that this actually changes anything. The mesh sdata will
> have a NULL bss pointer, so the second condition in sta_info_get_bss()
> can't be true.
>
> Therefore, only the first condition can ever be considered, which is
> exactly the same as sta_info_get(), no?
Yes. My current patch does not make sense since I see no difference
calling sta_info_get or sta_info_get_bss in my case.
The same applies to ieee80211_add_key.
---
Chun-Yeow