bug 456 [REGRESSION 0.7.3-6 => 1.0-2] WPA-PSK + openmoko: unable to get DHCPACK (resend #1)

Timo Juhani Lindfors timo.lindfors at iki.fi
Sat Jun 30 11:13:02 EDT 2012


[ Resending a copy without the attachment since
 http://lists.shmoo.com/pipermail/hostap/2012-June/026251.html does not
 seem to show the original message since it contains an attachment and I
 really want to make sure that the discussion is indexed by search
 engines so that others can benefit from our results. ]

Jouni Malinen <j at w1.fi> writes:
> Well, they just confirmed that the driver does not seem to indicate when
> scan results are available.

Ok. How should it indicate this? The source code at

http://gitorious.org/pkg-fso/linux-2-6-gta02/blobs/gta02/debian/patches/features/gta02/0032-Add-ar6000-wireless-driver.patch

shows ar6000_ioctl_siwscan() with

    ar->scan_complete = 0;
    wait_event_interruptible_timeout(ar6000_scan_queue, ar->scan_complete,
                                     5 * HZ);

and ar6000_scanComplete_event() with

    ar->scan_complete = 1;
    wake_up_interruptible(&ar6000_scan_queue);

Using

sudo killall dhclient
sudo killall wpa_supplicant
om wifi power 0
om wifi power 1
while ! ip link show wlan; do sleep 1; done
om wifi maxperf wlan 1
sudo rm -f /tmp/wpasupplicant.log
sudo wpa_supplicant -B -f /tmp/wpasupplicant.log -P /var/run/wpa_supplicant.wlan.pid -i wlan -D wext -t -ddd -C /var/run/wpa_supplicant
while [ ! -e /var/run/wpa_supplicant ]; do sleep 0.5; done
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan add_network
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 ssid "\"SoneraGateway00-26-44-A1-45-A9\""
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 psk "\"Thaeret0\""
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan enable_network 0
sudo dhclient -d wlan

and

sudo stap -e 'probe module("ar6000").function("ar6000_ioctl_siwscan"), module("ar6000").function("ar6000_scanComplete_event") { printf("%d %s\n", gettimeofday_us(), probefunc()); } probe module("ar6000").function("ar6000_ioctl_siwscan").return { printf("%d %s returned\n", gettimeofday_us(), probefunc()); }'

I see

1341061682435032 ar6000_ioctl_siwscan
1341061685389787 ar6000_scanComplete_event
1341061685389787 ar6000_ioctl_siwscan returned

The matching wpa_supplicant.log.gz is attached but here are the most
relevant lines:

...
1341061682.437789: CTRL_IFACE: ENABLE_NETWORK id=0
1341061682.438047: wlan: Setting scan request: 0 sec 0 usec
1341061682.438510: wlan: State: INACTIVE -> SCANNING
1341061682.438715: wlan: Starting AP scan for wildcard SSID
1341061685.391121: Scan requested (ret=0) - scan timeout 10 seconds
1341061695.399522: Scan timeout - try to get results
1341061695.399843: wlan: Event SCAN_RESULTS (3) received
1341061695.401823: Received 3223 bytes of scan results (13 BSSes)
1341061695.402211: Sorted scan results
1341061695.402347: 00:1e:69:36:5f:11 freq=2462 qual=19 noise=-95 level=-76 flags=0x0
1341061695.402506: 68:7f:74:1b:ce:f8 freq=2412 qual=17 noise=-95 level=-78 flags=0x0
1341061695.402599: 00:26:44:a1:45:a9 freq=2437 qual=15 noise=-95 level=-80 flags=0x0
...

> That's not enough for ap_scan 2 mode. You will need to specify the
> security policy in full, i.e., set key_mgmt, pairwise, group, and proto
> parameters to match with the network you are using. These seemed to be
> key_mgmt=WPA-PSK, pairwise=CCMP, group=TKIP, proto=RSN based on the
> debug logs with ap_scan 1. This does not match with the wpa_supplicant
> defaults:

I can confirm that the following works:

sudo killall dhclient
sudo killall wpa_supplicant
om wifi power 0
om wifi power 1
while ! ip link show wlan; do sleep 1; done
om wifi maxperf wlan 1
sudo rm -f /tmp/wpasupplicant.log
sudo wpa_supplicant -B -f /tmp/wpasupplicant.log -P /var/run/wpa_supplicant.wlan.pid -i wlan -D wext -t -ddd -C /var/run/wpa_supplicant
while [ ! -e /var/run/wpa_supplicant ]; do sleep 0.5; done
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan ap_scan 2
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan add_network
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 key_mgmt WPA-PSK
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 pairwise CCMP
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 group TKIP
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 proto RSN
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 ssid "\"SoneraGateway00-26-44-A1-45-A9\""
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 psk "\"Thaeret0\""
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan enable_network 0
sudo dhclient -d wlan

(However this is not very practical since I don't want to manually
specify such parameters for the networks that I visit...)


More information about the HostAP mailing list