I've got an ibss network in the neighbourhood, and their nwid
doesn't show up in ifconfig scan output because ifconfig chooses
to only show that for APs.

This diff changes the line:
                bssid 02:ca:ff:ee:ba:be lladdr 00:18:84:16:8c:ed 43dB 54M 
ibss,short_preamble cache

to the more informative:
                nwid olsr.freifunk.net chan 10 bssid 02:ca:ff:ee:ba:be lladdr 
00:18:84:16:8c:ed 43dB 54M ibss,short_preamble cache

Makes sense?

Index: ifconfig.c
===================================================================
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.277
diff -u -p -r1.277 ifconfig.c
--- ifconfig.c  12 Nov 2013 04:59:02 -0000      1.277
+++ ifconfig.c  30 Nov 2013 21:08:54 -0000
@@ -2209,7 +2209,8 @@ ieee80211_printnode(struct ieee80211_nod
 {
        int len;
 
-       if (nr->nr_flags & IEEE80211_NODEREQ_AP) {
+       if (nr->nr_flags & IEEE80211_NODEREQ_AP ||
+           nr->nr_capinfo & IEEE80211_CAPINFO_IBSS) {
                len = nr->nr_nwid_len;
                if (len > IEEE80211_NWID_LEN)
                        len = IEEE80211_NWID_LEN;
@@ -2218,12 +2219,12 @@ ieee80211_printnode(struct ieee80211_nod
                putchar(' ');
 
                printf("chan %u ", nr->nr_channel);
-       }
 
-       if (nr->nr_flags & IEEE80211_NODEREQ_AP)
                printf("bssid %s ",
                    ether_ntoa((struct ether_addr*)nr->nr_bssid));
-       else
+       }
+
+       if ((nr->nr_flags & IEEE80211_NODEREQ_AP) == 0)
                printf("lladdr %s ",
                    ether_ntoa((struct ether_addr*)nr->nr_macaddr));

Reply via email to