Bug 217317 - [patch] ifconfig extend printwpsie() to display more WPS attributes
Summary: [patch] ifconfig extend printwpsie() to display more WPS attributes
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Oleksandr Tymoshenko
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-02-24 01:58 UTC by J.R. Oldroyd
Modified: 2019-02-11 08:50 UTC (History)
4 users (show)

See Also:


Attachments
patch to extend WPS IE display for more attributes (14.79 KB, patch)
2017-02-24 01:58 UTC, J.R. Oldroyd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J.R. Oldroyd 2017-02-24 01:58:28 UTC
Created attachment 180253 [details]
patch to extend WPS IE display for more attributes

While doing the work to debug PR#217312, I saw that ifconfig's printwpsie() was printing very little of the attributes in the WPS IE.  I therefore went ahead and extended it some more.  Patch attached.

This is still not a complete set of attributes.  I have added only the ones I am seeing broadcast here, so that I am able to check the code works.  I do not have the WPS IE technical spec (can't find it, perhaps it is hidden behind a membership paywall somewhere).  So these additions are based on info gleaned from:

    src/contrib/wpa/wpa_supplicant/wps_supplicant.c
    src/contrib/wpa/src/wps/*

There was a note from a previous developer that certain #defines should be moved from ifieee80211.c to a separate header, so I have added <net80211/ieee80211_wps.h> with those and the newly added #defines.  I don't know if there's a Makefile somewhere that needs to know about this new file, if there is, please add this file to it.

This is tested on 11.0-stable.  It can be MFC'd.
Comment 1 commit-hook freebsd_committer 2019-01-20 00:46:18 UTC
A commit references this bug:

Author: gonzo
Date: Sun Jan 20 00:45:45 UTC 2019
New revision: 343204
URL: https://svnweb.freebsd.org/changeset/base/343204

Log:
  [ifconfig] Print more WPS attributes in verbose "list scan" output

  - Move WPS related defines to dedicated file
  - Add handlers for more WPS attributes

  PR:		217317
  Submitted by:	J.R. Oldroyd <fbsd@opal.com>
  MFC after:	3 weeks

Changes:
  head/sbin/ifconfig/ifieee80211.c
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_wps.h
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-20 00:55:30 UTC
Thanks for submitting the patch. I did some modifications and committed it to the repo.

Changes from the original patch:

- Removed nested <> from the fields that can't contain spaces, like vendor ID. Nested <> makes output harder to parse
- Changed string attributes format from "%*s" to "%.*s", the former ignores length and prints garbage at the end of the value. 
- Added SPDX tag to the new header
Comment 3 commit-hook freebsd_committer 2019-02-11 08:50:15 UTC
A commit references this bug:

Author: gonzo
Date: Mon Feb 11 08:49:57 UTC 2019
New revision: 343999
URL: https://svnweb.freebsd.org/changeset/base/343999

Log:
  MFC r343204:

  [ifconfig] Print more WPS attributes in verbose "list scan" output

  - Move WPS related defines to dedicated file
  - Add handlers for more WPS attributes

  PR:		217317
  Submitted by:	J.R. Oldroyd <fbsd@opal.com>

Changes:
_U  stable/12/
  stable/12/sbin/ifconfig/ifieee80211.c
  stable/12/sys/net80211/ieee80211.h
  stable/12/sys/net80211/ieee80211_wps.h