Ignore:
Timestamp:
2011-11-09T12:47:44+01:00 (5 years ago)
Author:
juhosg
Message:

pacakge/iw: don't show a stray ']' if the chain signal attribute list is empty

Without the patch, the output of 'station dump' command looks weird in
some cases:

root@OpenWrt:/# iw dev wlan0 station dump
Station 00:21:27:cb:57:02 (on wlan0)

inactive time: 190 ms
rx bytes: 36652
rx packets: 149
tx bytes: 1998
tx packets: 16
tx retries: 0
tx failed: 0
signal: -31 ] dBm
signal avg: -30 [-32, -36] dBm
tx bitrate: 5.5 MBit/s
rx bitrate: 54.0 MBit/s

root@OpenWrt:/#

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/iw/patches/120-per_chain_signal_strength.patch

    r28385 r28879  
    11--- a/station.c 
    22+++ b/station.c 
    3 @@ -61,6 +61,31 @@ static void print_sta_bitrate(struct nla 
     3@@ -61,6 +61,33 @@ static void print_sta_bitrate(struct nla 
    44        } 
    55 } 
     
    2525+                               (int8_t) nla_get_u8(attr)); 
    2626+       } 
    27 +       snprintf(cur, sizeof(buf) - (cur - buf), "] "); 
     27+ 
     28+       if (i) 
     29+               snprintf(cur, sizeof(buf) - (cur - buf), "] "); 
    2830+ 
    2931+       return buf; 
     
    3335 { 
    3436        struct nlattr *tb[NL80211_ATTR_MAX + 1]; 
    35 @@ -81,7 +106,10 @@ static int print_sta_handler(struct nl_m 
     37@@ -81,7 +108,10 @@ static int print_sta_handler(struct nl_m 
    3638                [NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 }, 
    3739                [NL80211_STA_INFO_TX_RETRIES] = { .type = NLA_U32 }, 
     
    4446        nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), 
    4547                  genlmsg_attrlen(gnlh, 0), NULL); 
    46 @@ -128,12 +156,18 @@ static int print_sta_handler(struct nl_m 
     48@@ -128,12 +158,18 @@ static int print_sta_handler(struct nl_m 
    4749        if (sinfo[NL80211_STA_INFO_TX_FAILED]) 
    4850                printf("\n\ttx failed:\t%u", 
Note: See TracChangeset for help on using the changeset viewer.