On 11/09/15(Fri) 17:33, Stefan Sperling wrote:
> There's no point in fixing the data rate of a wireless interface
> except for development/debugging purposes.
>
> So stop advertising these modes in ifconfig.
> Shortens the output of ifconfig media considerably.
>
> $ ifconfig iwn0 media
> iwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> lladdr 58:94:6b:06:70:04
> priority: 4
> groups: wlan
> media: IEEE802.11 autoselect
> status: no network
> ieee80211: nwid ""
> supported media:
> media autoselect
> media autoselect mediaopt monitor
> media autoselect mode 11a
> media autoselect mode 11a mediaopt monitor
> media autoselect mode 11b
> media autoselect mode 11b mediaopt monitor
> media autoselect mode 11g
> media autoselect mode 11g mediaopt monitor
> $
>
> ok?
Yes, please!
>
> Index: ifconfig.c
> ===================================================================
> RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
> retrieving revision 1.300
> diff -u -p -r1.300 ifconfig.c
> --- ifconfig.c 11 Sep 2015 13:02:59 -0000 1.300
> +++ ifconfig.c 11 Sep 2015 15:27:55 -0000
> @@ -3048,6 +3048,17 @@ status(int link, struct sockaddr_dl *sdl
> for (type = IFM_NMIN; type <= IFM_NMAX; type += IFM_NMIN) {
> for (i = 0, printed_type = 0; i < ifmr.ifm_count; i++) {
> if (IFM_TYPE(media_list[i]) == type) {
> +
> + /*
> + * Don't advertise media with fixed
> + * data rates for wireless interfaces.
> + * Normal people don't need these.
> + */
> + if (type == IFM_IEEE80211 &&
> + (media_list[i] & IFM_TMASK) !=
> + IFM_AUTO)
> + continue;
> +
> if (printed_type == 0) {
> printf("\tsupported media:\n");
> printed_type = 1;
>