From: Brian Cavagnolo Date: Thu, 27 Aug 2009 18:15:20 +0000 (-0700) Subject: iw: fix NL80211_STA_INFO_PLINK_STATE printing in station dump X-Git-Tag: v0.9.18~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dbaabba182fd62a6f8d4e22f8ee84906599dbf25;p=thirdparty%2Fiw.git 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. Signed-off-by: Brian Cavagnolo --- diff --git a/station.c b/station.c index 0fff92d..a4865f9 100644 --- a/station.c +++ b/station.c @@ -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;