]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix NL80211_STA_INFO_PLINK_STATE printing in station dump
authorBrian Cavagnolo <brian@cozybit.com>
Thu, 27 Aug 2009 18:15:20 +0000 (11:15 -0700)
committerJohannes Berg <johannes@sipsolutions.net>
Thu, 27 Aug 2009 18:21:19 +0000 (20:21 +0200)
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 <brian@cozybit.com>
station.c

index 0fff92d6e34f5892050894b579f7f0dac501f2a2..a4865f9d7c536c4e127d10e8ac81245986e0bd4e 100644 (file)
--- 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;