Adding a vendor Information Element to beacon / probe response frames

Etan Kissling kissling at oberon.ch
Wed Jun 15 07:13:14 PDT 2016


I've retried with the latest hostapd release, but same result: The vendor IE is not being broadcast, although it is specified in hostapd.conf.

Is there any other method to broadcast a vendor Information Element on Linux?
Where should I dig down into? Any additional logs I could enable?




These were my complete steps, from a clean Raspbian Jessie Lite 2016-05-27 installation on a Raspberry Pi 3 Model B.


sudo raspi-config
1. Expand filesystem
2. Change user password
3. <Finish> => Reboot

sudo apt-get update && sudo apt-get upgrade

sudo apt-get install bison flex

curl -LO http://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar /xvzf libnl-3.2.25.tar
cd libnl-3.2.25/
./configure
make
sudo make install
cd ..

sudo apt-get install libssl-dev

curl -LO https://w1.fi/releases/hostapd-2.5.tar.gz
tar -xvzf hostapd-2.5.tar.gz
cd hostapd-2.5/hostapd
cp defconfig .config
EDIT .config:
    # driver_nl80211.c requires libnl. If you are compiling it yourself
    # you may need to point hostapd to your version of libnl.
    #
    #CFLAGS += -I$<path to libnl include files>
    #LIBS += -L$<path to libnl library files>
 +  CFLAGS += -I/usr/local/include/libnl3
 +  LIBS += -L/usr/local/lib

    # Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
 -  #CONFIG_LIBNL32=y
 +  CONFIG_LIBNL32=y

make
sudo make install
cd ../..

sudo mkdir /etc/hostapd
sudo EDIT /etc/hostapd/hostapd.conf

 +  interface=wlan0
 +  driver=nl80211

 +  ssid=Test
 +  country_code=CH
 +  hw_mode=g
 +  channel=6
 +  vendor_elements=DD0401020300


sudo ifdown wlan0
sudo hostapd -dd /etc/hostapd/hostapd.conf




=======================================================
Log
=======================================================


pi at raspberrypi:~ $ sudo hostapd -dd /etc/hostapd/hostapd.conf
hostapd: /lib/arm-linux-gnueabihf/libnl-genl-3.so.200: no version information available (required by hostapd)
hostapd: /lib/arm-linux-gnueabihf/libnl-3.so.200: no version information available (required by hostapd)
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
nl80211: Using driver-based roaming
nl80211: TDLS supported
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=1
nl80211: Create interface iftype 6 (MONITOR)
Failed to create interface mon.wlan0: -95 (Operation not supported)
nl80211: Driver does not support monitor interface type - try to run without it
nl80211: Enable Probe Request reporting nl_preq=0x1f06528
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0x1f06528 match=
nl80211: Register frame command failed (type=64): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Failed to enable Probe Request frame reporting in AP mode
nl80211: Add own interface ifindex 3
nl80211: if_indices[16]: 3
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Previous country code CH, new country code CH 
nl80211: Regulatory information - country=CH (DFS-ETSI)
nl80211: 2402-2482 @ 40 MHz 20 mBm
nl80211: 5170-5250 @ 80 MHz 20 mBm
nl80211: 5250-5330 @ 80 MHz 20 mBm (DFS)
nl80211: 5490-5710 @ 160 MHz 27 mBm (DFS)
nl80211: 57000-66000 @ 2160 MHz 40 mBm
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=12 freq=2467 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=13 freq=2472 MHz max_tx_power=20 dBm
Completing interface initialization
Mode: IEEE 802.11g  Channel: 6  Frequency: 2437 MHz
DFS 0 channels required radar detection
nl80211: Set freq 2437 (ht_enabled=0, vht_enabled=0, bandwidth=20 MHz, cf1=2437 MHz, cf2=0 MHz)
  * freq=2437
  * vht_enabled=0
  * ht_enabled=0
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x1f05e78 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
nl80211: Station flush failed: ret=-14 (Bad address)
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan0 ff:ff:ff:ff:ff:ff --> 0 (Success)
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr b8:27:eb:01:2d:01 and ssid "Test"
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=55): 80 00 00 00 ff ff ff ff ff ff b8 27 eb 01 2d 01 b8 27 eb 01 2d 01 00 00 00 00 00 00 00 00 00 00 64 00 01 04 00 04 54 65 73 74 01 08 82 84 8b 96 0c 12 18 24 03 01 06
nl80211: Beacon tail - hexdump(len=15): 2a 01 04 32 04 30 48 60 6c dd 04 01 02 03 00
nl80211: ifindex=3
nl80211: beacon_int=100
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=4):
     54 65 73 74                                       Test            
  * beacon_int=100
nl80211: hidden SSID not in use
nl80211: privacy=0
nl80211: auth_algs=0x3
nl80211: wpa_version=0x0
nl80211: key_mgmt_suites=0x4
nl80211: pairwise_ciphers=0x0
nl80211: group_cipher=0x1
nl80211: SMPS mode - off
nl80211: beacon_ies - hexdump(len=6): dd 04 01 02 03 00
nl80211: proberesp_ies - hexdump(len=6): dd 04 01 02 03 00
nl80211: Set wlan0 operstate 0->1 (UP)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
Failed to set TX queue parameters for queue 0.
Failed to set TX queue parameters for queue 1.
Failed to set TX queue parameters for queue 2.
Failed to set TX queue parameters for queue 3.
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED 
wlan0: Setup of interface done.
ctrl_iface not configured!
random: Got 20/20 bytes from /dev/random
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
nl80211: Event message available
nl80211: Drv Event 19 (NL80211_CMD_NEW_STATION) received for wlan0
nl80211: New station a0:99:9b:02:db:59
nl80211: Assoc Req IEs - hexdump(len=102): 00 04 54 65 73 74 01 08 82 84 8b 96 24 30 48 6c 32 04 0c 12 18 60 21 02 06 14 24 02 01 0d 2d 1a ad 49 17 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 01 04 dd 1e 00 90 4c 33 ad 49 17 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 dd 07 00 50 f2 02 00 01 00
wlan0: Event ASSOC (0) received
wlan0: STA a0:99:9b:02:db:59 IEEE 802.11: associated
STA did not include WPS/RSN/WPA IE in (Re)AssocReq
  New STA
ap_sta_add: register ap_handle_timer timeout for a0:99:9b:02:db:59 (300 seconds - ap_max_inactivity)
nl80211: Set STA flags - ifname=wlan0 addr=a0:99:9b:02:db:59 total_flags=0x0 flags_or=0x0 flags_and=0xfffffff1 authorized=0
wlan0: AP-STA-CONNECTED a0:99:9b:02:db:59
wlan0: STA a0:99:9b:02:db:59 RADIUS: starting accounting session A2185ED6-00000000
IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
hostapd_new_assoc_sta: reschedule ap_handle_timer timeout for a0:99:9b:02:db:59 (300 seconds - ap_max_inactivity)
nl80211: Event message available
nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for wlan0
nl80211: Delete station a0:99:9b:02:db:59
wlan0: Event DISASSOC (1) received
wlan0: STA a0:99:9b:02:db:59 IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED a0:99:9b:02:db:59
nl80211: sta_remove -> DEL_STATION wlan0 a0:99:9b:02:db:59 --> 0 (Success)
ap_free_sta: cancel ap_handle_timer for a0:99:9b:02:db:59
^CSignal 2 received - terminating
hostapd_interface_deinit_free(0x1f052d8)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x1f052d8)
wlan0: interface state ENABLED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan0 ff:ff:ff:ff:ff:ff --> 0 (Success)
wlan0: AP-DISABLED 
hostapd_cleanup(hapd=0x1f05e78 (wlan0))
hostapd_free_hapd_data(wlan0)
hostapd_interface_deinit_free: driver=0x871fc drv_priv=0x1f067c8 -> hapd_deinit
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=3)
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Teardown AP(wlan0) - device_ap_sme=1 use_monitor=1
hostapd_interface_free(0x1f052d8)
hostapd_interface_free: free hapd 0x1f05e78
hostapd_cleanup_iface(0x1f052d8)
hostapd_cleanup_iface_partial(0x1f052d8)
hostapd_cleanup_iface: free iface=0x1f052d8



Wireshark:

Frame 52: 206 bytes on wire (1648 bits), 206 bytes captured (1648 bits) on interface 0
Radiotap Header v0, Length 25
802.11 radio information
IEEE 802.11 Beacon frame, Flags: ........C
IEEE 802.11 wireless LAN management frame
    Fixed parameters (12 bytes)
        Timestamp: 0x0000000000a41541
        Beacon Interval: 0.102400 [Seconds]
        Capabilities Information: 0x0501
    Tagged parameters (141 bytes)
        Tag: SSID parameter set: Test
        Tag: Supported Rates 1(B), 2(B), 5.5(B), 11(B), 18, 24, 36, 54, [Mbit/sec]
        Tag: DS Parameter set: Current Channel: 6
        Tag: Traffic Indication Map (TIM): DTIM 1 of 0 bitmap
        Tag: Country Information: Country Code CH, Environment Any
        Tag: Power Constraint: 0
        Tag: TPC Report Transmit Power: 17, Link Margin: 0
        Tag: ERP Information
        Tag: Extended Supported Rates 6, 9, 12, 48, [Mbit/sec]
        Tag: HT Capabilities (802.11n D1.10)
        Tag: HT Information (802.11n D1.10)
        Tag: Extended Capabilities (1 octet)
        Tag: Vendor Specific: Broadcom
        Tag: Vendor Specific: Microsof: WMM/WME: Parameter Element

0000   00 00 19 00 6f 08 00 00 71 56 61 dc 00 00 00 00  ....o...qVa.....
0010   10 02 85 09 80 04 e6 a0 00 80 00 00 00 ff ff ff  ................
0020   ff ff ff b8 27 eb 01 2d 01 b8 27 eb 01 2d 01 70  ....'..-..'..-.p
0030   c0 41 15 a4 00 00 00 00 00 64 00 01 05 00 04 54  .A.......d.....T
0040   65 73 74 01 08 82 84 8b 96 24 30 48 6c 03 01 06  est......$0Hl...
0050   05 04 01 02 00 00 07 06 43 48 20 01 0d 14 20 01  ........CH ... .
0060   00 23 02 11 00 2a 01 00 32 04 0c 12 18 60 2d 1a  .#...*..2....`-.
0070   21 00 1f ff 00 00 00 00 00 00 00 00 00 80 01 00  !...............
0080   00 00 00 00 00 00 00 00 00 00 3d 16 06 08 15 00  ..........=.....
0090   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00a0   00 00 7f 01 04 dd 09 00 10 18 02 01 10 0c 00 00  ................
00b0   dd 18 00 50 f2 02 01 01 80 00 03 a4 00 00 27 a4  ...P..........'.
00c0   00 00 42 43 5e 00 62 32 2f 00 38 da bb 11        ..BC^.b2/.8...


> On 14 Jun 2016, at 20:29, Etan Kissling <kissling at oberon.ch> wrote:
> 
> Greetings,
> 
> I'd like to add a vendor-specific Information Element to the Beacon and Probe Response frames.
> 
> =========================================================================
> My hostapd.conf looks like this:
> =========================================================================
> interface=wlan0
> # driver=nl80211   # doesn't matter if I choose nl80211 or the default, same behavior
> logger_stdout=-1
> logger_stdout_level=0
> ctrl_interface=/var/run/hostapd
> ctrl_interface_group=0
> 
> ssid=Test
> country_code=CH
> hw_mode=g
> channel=6
> vendor_elements=DD<length><oui><subtype><elements>
> 
> 
> =========================================================================
> Running on Raspberry Pi 3 Model B with the hostapd from apt-get:
> =========================================================================
> pi at raspberrypi:~ $ hostapd -v
> hostapd v2.3
> User space daemon for IEEE 802.11 AP management,
> IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
> Copyright (c) 2002-2014, Jouni Malinen <j at w1.fi> and contributors
> 
> 
> =========================================================================
> The AP works fine (I can connect, but don't get an IP because I don't need DHCP -- I just want the vendor element in the beacon for now)
> =========================================================================
> pi at raspberrypi:~ $ sudo hostapd /etc/hostapd/hostapd.conf
> Configuration file: /etc/hostapd/hostapd.conf
> Failed to create interface mon.wlan0: -95 (Operation not supported)
> wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
> wlan0: Could not connect to kernel driver
> Using interface wlan0 with hwaddr yy:yy:yy:yy:yy:yy and ssid "Test"
> wlan0: interface state COUNTRY_UPDATE->ENABLED
> wlan0: AP-ENABLED 
> wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated
> wlan0: AP-STA-CONNECTED xx:xx:xx:xx:xx:xx
> wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: starting accounting session XXXXXXXX-00000000
> wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: disassociated
> wlan0: AP-STA-DISCONNECTED xx:xx:xx:xx:xx:xx
> 
> 
> =========================================================================
> When I check with Wireshark, the vendor element is not included in the beacons, though (OS X with sudo open Wireshark.app, and Monitoring on, while associated with the AP to monitor its channel).
> =========================================================================
> Frame 610: 206 bytes on wire (1680 bits), 206 bytes captured (1680 bits) on interface 0
> Radiotap Header v0, Length 25
> 802.11 radio information
> IEEE 802.11 Beacon frame, Flags: ........C
> IEEE 802.11 wireless LAN management frame
>    Fixed parameters (12 bytes)
>    Tagged parameters (141 bytes)
>        Tag: SSID parameter set: Test
>        Tag: Supported Rates 1(B), 2(B), 5.5(B), 11(B), 18, 24, 36, 54, [Mbit/sec]
>        Tag: DS Parameter set: Current Channel: 6
>        Tag: Traffic Indication Map (TIM): DTIM 0 of 0 bitmap
>        Tag: Country Information: Country Code CH, Environment Any
>        Tag: Power Constraint: 0
>        Tag: TPC Report Transmit Power: 17, Link Margin: 0
>        Tag: ERP Information
>        Tag: Extended Supported Rates 6, 9, 12, 48, [Mbit/sec]
>        Tag: HT Capabilities (802.11n D1.10)
>        Tag: HT Information (802.11n D1.10)
>        Tag: Extended Capabilities (1 octet)
>        Tag: Vendor Specific: Broadcom
>        Tag: Vendor Specific: Microsof: WMM/WME: Parameter Element
> 
> 
> 
> I expect my additional vendor-specific element to be present in this list, but it's not.
> 
> How can I expose my vendor-specific Information Element to the Probe response and Beacon frames?
> 
> 
> Thanks
> 
> Etan
> 
> 
> 
> 




More information about the Hostap mailing list