Skip to contentSkip to conversation

iw: fix NL80211_STA_INFO_PLINK_STATE printing in station dump

PATCH Applied Brian Cavagnolo 2 participants 2 messages Aug 27, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iw: fix NL80211_STA_INFO_PLINK_STATE printing in station dump

NL80211_STA_INFO_PLINK_STATE is a u8, not a u16. This bug was causing unexpected output on big endian machines.

---
 station.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
station.c +1 -1
index 0fff92d..a4865f9 100644
@@ -127,7 +127,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
 		printf("\n\tmesh plid:\t%d",
 			nla_get_u16(sinfo[NL80211_STA_INFO_PLID]));
 	if (sinfo[NL80211_STA_INFO_PLINK_STATE]) {
-		switch (nla_get_u16(sinfo[NL80211_STA_INFO_PLINK_STATE])) {
+		switch (nla_get_u8(sinfo[NL80211_STA_INFO_PLINK_STATE])) {
 		case LISTEN:
 			strcpy(state_name, "LISTEN");
 			break;
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 2 lines · Brian Cavagnolo

NL80211_STA_INFO_PLINK_STATE is a u8, not a u16. This bug was causing unexpected output on big endian machines.

Applied, thanks.

johannes