From owner-freebsd-mobile@FreeBSD.ORG Wed Aug 6 15:38:17 2008 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB9131065674 for ; Wed, 6 Aug 2008 15:38:17 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 66C6E8FC0C for ; Wed, 6 Aug 2008 15:38:17 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m76FcG3c059885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Aug 2008 08:38:17 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4899C568.3060807@freebsd.org> Date: Wed, 06 Aug 2008 08:38:16 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Johann Hugo References: <200808061327.03028.jhugo@meraka.csir.co.za> In-Reply-To: <200808061327.03028.jhugo@meraka.csir.co.za> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-DCC-Rhyolite-Metrics: ebb.errno.com; whitelist Cc: freebsd-mobile@freebsd.org Subject: Re: WPA in adhoc mode X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2008 15:38:17 -0000 Johann Hugo wrote: > I'm trying to setup WPA between two Atheros wifi adapters in adhoc mode, but I > cannot get it to work. Any hints to get it to work ? > > According to the "wpa_supplicant Reference Manual 0.4.x" it should be > possible: > --------------------------------------------- > IEEE 802.11 operation mode (Infrastucture/IBSS). > 0 = infrastructure (Managed) mode, i.e., associate with an AP. > 1 = IBSS (ad-hoc, peer-to-peer) > Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP) and > key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has to be > set to 2 for IBSS. WPA-None requires following network block options: > proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP > (or CCMP, but not both), and psk must also be set (either directly or using > ASCII passphrase). > -------------------------------------------- > > I'm running 7.0-STABLE, build on 30 Jul 2008. > hw.ath.hal.version: 0.9.20.3 > > ath0: flags=8843 metric 0 mtu 1500 > ether 00:80:48:50:9d:dd > inet6 fe80::280:48ff:fe50:9ddd%ath0 prefixlen 64 scopeid 0x1 > inet6 fd9c:6829:597c:20:280:48ff:fe50:9ddd prefixlen 64 > inet6 fd9c:6829:597c:20:: prefixlen 64 anycast > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > ssid ptamesh channel 13 (2472 Mhz 11g) bssid 02:15:6d:53:39:75 > authmode OPEN privacy OFF txpower 31.5 scanvalid 60 bgscan > bgscanintvl 300 bgscanidle 250 roam:rssi11g 7 roam:rate11g 5 > protmode CTS burst > > mesh-9ddd:~ # more /etc/wpa_supplicant.conf > ap_scan=2 > > network={ > ssid="ptamesh" > mode=1 > proto=WPA > key_mgmt=WPA-NONE > pairwise=NONE > group=TKIP > psk="mesh-ipv6" > } > > mesh-9ddd:~ # wpa_supplicant -d -i ath0 -c /etc/wpa_supplicant.conf > Initializing interface 'ath0' conf '/etc/wpa_supplicant.conf' driver 'default' > ctrl_interface 'N/A' bridge 'N/A' > Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf' > Reading configuration file '/etc/wpa_supplicant.conf' > ap_scan=2 > Priority group 0 > id=0 ssid='ptamesh' > Initializing interface (2) 'ath0' > EAPOL: SUPP_PAE entering state DISCONNECTED > EAPOL: KEY_RX entering state NO_KEY_RECEIVE > EAPOL: SUPP_BE entering state INITIALIZE > EAP: EAP entering state DISABLED > EAPOL: External notification - portEnabled=0 > EAPOL: External notification - portValid=0 > Own MAC address: 00:80:48:50:9d:dd > wpa_driver_bsd_set_wpa: enabled=1 > wpa_driver_bsd_set_wpa_internal: wpa=3 privacy=1 > wpa_driver_bsd_del_key: keyidx=0 > wpa_driver_bsd_del_key: keyidx=1 > wpa_driver_bsd_del_key: keyidx=2 > wpa_driver_bsd_del_key: keyidx=3 > wpa_driver_bsd_set_countermeasures: enabled=0 > wpa_driver_bsd_set_drop_unencrypted: enabled=1 > Setting scan request: 0 sec 100000 usec > Added interface ath0 > State: DISCONNECTED -> SCANNING > Trying to associate with SSID 'ptamesh' > Cancelling scan request > WPA: clearing own WPA/RSN IE > Automatic auth_alg selection: 0x1 > wpa_driver_bsd_set_auth_alg alg 0x1 authmode 1 > WPA: No WPA/RSN IE available from association info > WPA: Set cipher suites based on configuration > WPA: Selected cipher suites: group 8 pairwise 1 key_mgmt 16 proto 1 > WPA: clearing AP WPA IE > WPA: clearing AP RSN IE > WPA: using GTK TKIP > WPA: using PTK NONE > WPA: using KEY_MGMT WPA-NONE > WPA: Set own WPA IE default - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 > f2 02 01 00 00 50 f2 00 01 00 00 50 f2 00 > No keys have been configured - skip key clearing > wpa_driver_bsd_set_key: alg=TKIP addr=ff:ff:ff:ff:ff:ff key_idx=0 set_tx=1 > seq_len=6 key_len=32 > wpa_driver_bsd_set_drop_unencrypted: enabled=1 > State: SCANNING -> ASSOCIATING > wpa_driver_bsd_associate: ssid 'ptamesh' wpa ie len 24 pairwise 0 group 2 key > mgmt 4 > ioctl[SIOCS80211, op 22, len 24]: Invalid argument > Association request to the driver failed > wpa_driver_bsd_set_key: alg=TKIP addr=ff:ff:ff:ff:ff:ff key_idx=0 set_tx=1 > seq_len=6 key_len=32 > Cancelling authentication timeout > State: ASSOCIATING -> COMPLETED > CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (auth) [id=-1 > id_str=] > EAPOL: External notification - portControl=ForceAuthorized > Looks like the driver is being told to associate which fails because the device is in adhoc mode--and so it returns an error and wpa_supplicant aborts the work. You might try disabling the request in the wpa_supplicant driver. I've never tried this config. If you can't get it work please file a PR so the issue isn't lost. Sam