git: 453d1a90f8f4 - main - net80211: improve one debug logging

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Tue, 22 Mar 2022 18:52:47 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=453d1a90f8f46637404adc0278d6f3f068542733

commit 453d1a90f8f46637404adc0278d6f3f068542733
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-03-22 14:40:12 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-03-22 18:51:43 +0000

    net80211: improve one debug logging
    
    When forcing DEUATH in ieee80211_sta_join1() log the current state
    we are coming from as well.  Note this isn't always the state we
    are expecting as iv_state was updated already, so contrary to the
    comment we usually do not see RUN there.
    Leave a comment earlier with regards to this as well.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/net80211/ieee80211_node.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 3ee46df2a570..43f90f860a2d 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -851,6 +851,7 @@ ieee80211_sta_join1(struct ieee80211_node *selbs)
 	 * Check if old+new node have the same address in which
 	 * case we can reassociate when operating in sta mode.
 	 */
+	/* XXX We'll not be in RUN anymore as iv_state got updated already? */
 	canreassoc = (obss != NULL &&
 		vap->iv_state == IEEE80211_S_RUN &&
 		IEEE80211_ADDR_EQ(obss->ni_macaddr, selbs->ni_macaddr));
@@ -896,8 +897,9 @@ ieee80211_sta_join1(struct ieee80211_node *selbs)
 			 * as a station.
 			 */
 			IEEE80211_DPRINTF(vap, IEEE80211_MSG_AUTH,
-			    "%s %p<%s> -> AUTH, FC0_SUBTYPE_DEAUTH\n",
-			    __func__, selbs, ether_sprintf(selbs->ni_macaddr));
+			    "%s %p<%s> %s -> AUTH, FC0_SUBTYPE_DEAUTH\n",
+			    __func__, selbs, ether_sprintf(selbs->ni_macaddr),
+			    ieee80211_state_name[vap->iv_state]);
 			ieee80211_new_state(vap, IEEE80211_S_AUTH,
 				IEEE80211_FC0_SUBTYPE_DEAUTH);
 		}