On Sat, May 30, 2020 at 03:49:24PM +0000, Mikolaj Kucharski wrote:
> I see. While I was looking around I found that in function
> ieee80211_node_leave_rsn() there seems to be dead code
> assignment of ni->ni_rsn_state. With below change kernel
> compiles and I'm running it on athn access point and athn
> client, without any issues so far. When checking objdump -d
> on ieee80211_node.o there seems to be one small chagne,
> with below diff.
Thanks. I will commit your patch.
This dead assignment dates back to damien@'s original "Kernel implementation
of the 4-way handshake" WPA support commit which included this change:
@@ -1044,6 +1176,29 @@ ieee80211_node_join(struct ieee80211com *ic, struct ie
}
/*
+ * Handle a station leaving an RSN network.
+ */
+void
+ieee80211_node_leave_rsn(struct ieee80211com *ic, struct ieee80211_node *ni)
+{
+ ni->ni_rsn_state = RSNA_DISCONNECTED;
+ ic->ic_rsnsta--;
+
+ ni->ni_rsn_state = RSNA_INITIALIZE;
+ if ((ni->ni_flags & IEEE80211_NODE_REKEY) &&
+ --ic->ic_rsn_keydonesta == 0)
+ ieee80211_setkeysdone(ic);
+ ni->ni_flags &= ~IEEE80211_NODE_REKEY;
+
+ ni->ni_rsn_gstate = RSNA_IDLE;
+
+ timeout_del(&ni->ni_rsn_timeout);
+ ni->ni_rsn_retries = 0;
+ ni->ni_port_valid = 0;
+ (*ic->ic_delete_key)(ic, ni, &ni->ni_pairwise_key);
+}
+
+/*
* Handle a station leaving an 11g network.
*/
void
>
> Index: sys/net80211/ieee80211_node.c
> ===================================================================
> RCS file: /cvs/src/sys/net80211/ieee80211_node.c,v
> retrieving revision 1.181
> diff -u -p -u -r1.181 ieee80211_node.c
> --- sys/net80211/ieee80211_node.c 5 May 2020 18:14:42 -0000 1.181
> +++ sys/net80211/ieee80211_node.c 30 May 2020 15:41:58 -0000
> @@ -2705,8 +2705,6 @@ ieee80211_node_leave_rsn(struct ieee8021
> {
> int rekeysta = 0;
>
> - ni->ni_rsn_state = RSNA_DISCONNECTED;
> -
> ni->ni_rsn_state = RSNA_INITIALIZE;
> if (ni->ni_flags & IEEE80211_NODE_REKEY) {
> ni->ni_flags &= ~IEEE80211_NODE_REKEY;
>
> --
> Regards,
> Mikolaj
>