mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-03-30 22:46:47 +02:00
sae: print state and transaction on received packets
This will make SAE a bit easier to debug in the future.
This commit is contained in:
parent
7fe55567bd
commit
799e7af9c7
18
src/sae.c
18
src/sae.c
@ -1226,10 +1226,28 @@ static int sae_verify_accepted(struct sae_sm *sm, uint16_t trans,
|
|||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *sae_state_to_str(enum sae_state state)
|
||||||
|
{
|
||||||
|
switch (state) {
|
||||||
|
case SAE_STATE_NOTHING:
|
||||||
|
return "nothing";
|
||||||
|
case SAE_STATE_COMMITTED:
|
||||||
|
return "committed";
|
||||||
|
case SAE_STATE_CONFIRMED:
|
||||||
|
return "confirmed";
|
||||||
|
case SAE_STATE_ACCEPTED:
|
||||||
|
return "accepted";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
static int sae_verify_packet(struct sae_sm *sm, uint16_t trans,
|
static int sae_verify_packet(struct sae_sm *sm, uint16_t trans,
|
||||||
uint16_t status, const uint8_t *frame,
|
uint16_t status, const uint8_t *frame,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
|
l_debug("rx trans=%u, state=%s", trans, sae_state_to_str(sm->state));
|
||||||
|
|
||||||
if (trans != SAE_STATE_COMMITTED && trans != SAE_STATE_CONFIRMED)
|
if (trans != SAE_STATE_COMMITTED && trans != SAE_STATE_CONFIRMED)
|
||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user