Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
[nrf fromlist] ap: Fix build warning about type mismatch
Browse files Browse the repository at this point in the history
The negation produces "long unsigned int" and as we use %d this causes a
build warning, introduce a bit macro for u8 to fix this.

Upstream PR: http://lists.infradead.org/pipermail/hostap/2023-December/042112.html

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 committed Dec 19, 2023
1 parent ae3ba3b commit bd0564c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ap/ieee802_1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2606,7 +2606,7 @@ int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
HOSTAPD_LEVEL_DEBUG,
"did not Ack EAPOL-Key frame (%scast index=%d)",
key->key_index & BIT(7) ? "uni" : "broad",
key->key_index & ~BIT(7));
key->key_index & ~BIT_U8(7));
/* TODO: re-send EAPOL-Key couple of times (with short delay
* between them?). If all attempt fail, report error and
* deauthenticate STA so that it will get new keys when
Expand Down
4 changes: 4 additions & 0 deletions src/utils/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ void perror(const char *s);
#define BIT(x) (1U << (x))
#endif

#ifndef BIT_U8
#define BIT_U8(n) (1U << (n))
#endif

/*
* Definitions for sparse validation
* (http://kernel.org/pub/linux/kernel/people/josh/sparse/)
Expand Down

0 comments on commit bd0564c

Please sign in to comment.