Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #1208 (new defect)

Opened 15 years ago

Oops while switching from adhoc to managed

Reported by: sven-ola@gmx.de Assigned to:
Priority: major Milestone:
Component: madwifi: 802.11 stack Version: v0.9.3
Keywords: adhoc managed modeswitch Cc:
Patch is attached: 0 Pending:

Description

While switching from vap(adhoc) to vap(client) a kernel oops shows up (nearly instantly after joining the access point && fully repeatable). I'll attach a workaround as well as some debug hints. System is a Kubuntu/Dapper with Linux pcacer 2.6.15-28-386 #1 PREEMPT Thu Feb 1 15:51:56 UTC 2007 i686 GNU/Linux and wifi0: Atheros 5212: mem=0xe0200000, irq=11.

Workaround:

diff --exclude '*~' -Nur madwifi-0.9.3.orig/net80211/ieee80211_input.c madwifi-0.9.3/net80211/ieee80211_input.c
--- madwifi-0.9.3.orig/net80211/ieee80211_input.c	2007-02-02 21:01:51.000000000 +0100
+++ madwifi-0.9.3/net80211/ieee80211_input.c	2007-03-20 20:11:43.000000000 +0100
@@ -275,6 +275,13 @@
 	dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK;
 	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
 	subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
+	/*
+	 * Sven-Ola: When switching from adhoc into client
+	 * mode, madwifi oopses here, because occasionally
+	 * the ic pointer is zero!? Mode switch done as usual 
+	 * by destroying vap(adhoc) and creating vap(client)
+	 */
+	if (0 == ic) goto err;
 	if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) {
 		switch (vap->iv_opmode) {
 		case IEEE80211_M_STA:

/etc/network/interfaces:

iface 1ath0 inet dhcp
	wireless_mode managed
	wireless_essid sven-ola
	wireless_key 0123456789abcdef0123456789
	madwifi_base wifi0

iface 2ath0 inet static
	post-up /etc/network/post-up.ath0
	address 104.198.65.69
	netmask 255.0.0.0
	broadcast 104.255.255.255
	wireless_mode ad-hoc
	wireless_channel 10
	wireless_essid olsr.freifunk.net
	wireless_rts 250
	wireless_frag off
	wireless_key off
	wireless_bssid 02:ca:ff:ee:ba:be
	madwifi_base wifi0

ifup 2ath0;ifdown 2ath0;ifup 1ath0 # filtered debug:

+ WLANCONFIG=/usr/local/bin/wlanconfig
+ '[' '!' -x /usr/local/bin/wlanconfig ']'
+ /usr/local/bin/wlanconfig 2ath0 create wlandev wifi0 wlanmode adhoc
+ IWCONFIG=/sbin/iwconfig
+ IWCONFIG=/sbin/iwconfig
+ '[' '!' -x /sbin/iwconfig ']'
+ /sbin/iwconfig 2ath0 mode ad-hoc
+ /sbin/iwconfig 2ath0 rts 250
+ /sbin/iwconfig 2ath0 frag off
+ eval /sbin/iwconfig 2ath0 key off
++ /sbin/iwconfig 2ath0 key off
+ /sbin/iwconfig 2ath0 channel 10
+ /sbin/iwconfig 2ath0 essid olsr.freifunk.net
+ WLANCONFIG=/usr/local/bin/wlanconfig
+ '[' '!' -x /usr/local/bin/wlanconfig ']'
+ /usr/local/bin/wlanconfig 2ath0 destroy
+ IWCONFIG=/sbin/iwconfig
+ '[' '!' -x /sbin/iwconfig ']'
+ WLANCONFIG=/usr/local/bin/wlanconfig
+ '[' '!' -x /usr/local/bin/wlanconfig ']'
+ /usr/local/bin/wlanconfig 1ath0 create wlandev wifi0 wlanmode sta
+ IWCONFIG=/sbin/iwconfig
+ IWCONFIG=/sbin/iwconfig
+ '[' '!' -x /sbin/iwconfig ']'
+ /sbin/iwconfig 1ath0 mode managed
+ eval /sbin/iwconfig 1ath0 key 0123456789abcdef0123456789
++ /sbin/iwconfig 1ath0 key 0123456789abcdef0123456789
+ /sbin/iwconfig 1ath0 essid sven-ola

ifup 2ath0;ifdown 2ath0;ifup 1ath0 # complete debug:

Configuring interface 2ath0=2ath0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/madwifi-ng
+ WLANCONFIG=/usr/local/bin/wlanconfig
+ '[' '!' -x /usr/local/bin/wlanconfig ']'
+ '[' -z wifi0 ']'
+ ip link list 2ath0
+ case "$IF_WIRELESS_MODE" in
+ MODE=adhoc
+ /usr/local/bin/wlanconfig 2ath0 create wlandev wifi0 wlanmode adhoc
+ exit 0
run-parts: executing /etc/network/if-pre-up.d/uml-utilities
+ test -x /usr/sbin/tunctl
+ test -n ''
+ exit 0
run-parts: executing /etc/network/if-pre-up.d/wireless-bssid
+ case "$METHOD" in
+ IWCONFIG=/sbin/iwconfig
+ '[' -n 02:ca:ff:ee:ba:be ']'
+ '[' 2at == ath ']'
+ '[' 2ath == wlan ']'
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
+ IWCONFIG=/sbin/iwconfig
+ '[' '!' -x /sbin/iwconfig ']'
+ '[' -n '' ']'
+ '[' -n ad-hoc ']'
+ /sbin/iwconfig 2ath0 mode ad-hoc
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n 250 ']'
+ /sbin/iwconfig 2ath0 rts 250
+ '[' -n off ']'
+ /sbin/iwconfig 2ath0 frag off
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n off ']'
+ eval /sbin/iwconfig 2ath0 key off
++ /sbin/iwconfig 2ath0 key off
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n 10 ']'
+ /sbin/iwconfig 2ath0 channel 10
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n olsr.freifunk.net ']'
+ /sbin/iwconfig 2ath0 essid olsr.freifunk.net
+ '[' -n '' ']'
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
+ '[' 2ath0 = lo ']'
+ WPA_SUP_BIN=/sbin/wpa_supplicant
+ WPA_SUP_PNAME=wpa_supplicant
+ WPA_SUP_PIDFILE=/var/run/wpa_supplicant.2ath0.pid
+ WPA_SUP_OPTIONS='-B -P /var/run/wpa_supplicant.2ath0.pid -i 2ath0'
+ WPA_CLI_BIN=/sbin/wpa_cli
+ WPA_CLI_PNAME=wpa_cli
+ WPA_CLI_PIDFILE=/var/run/wpa_cli.2ath0.pid
+ WPA_CLI_ACTFILE=/var/run/wpa_cli.2ath0.action
+ WPA_CLI_OPTIONS='-B -P /var/run/wpa_cli.2ath0.pid -i 2ath0'
+ WPA_COMMON_CTRL_IFACE=/var/run/wpa_supplicant
+ '[' '!' -x /sbin/wpa_supplicant -o '!' -x /sbin/wpa_cli ']'
+ '[' -s '' ']'
+ env
+ grep -q '^IF_WPA'
+ exit 0

ifconfig 2ath0 104.198.65.69 netmask 255.0.0.0 broadcast 104.255.255.255 	   	up

/etc/network/post-up.ath0
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/mountnfs
+ '[' 2ath0 '!=' lo ']'
+ test -f /etc/fstab
+ '[' -f /etc/default/rcS ']'
+ . /etc/default/rcS
++ TMPTIME=0
++ SULOGIN=no
++ DELAYLOGIN=no
++ UTC=no
++ VERBOSE=no
++ EDITMOTD=yes
++ FSCKFIX=no
+ . /lib/init/functions.sh
+ mkdir /var/run/network/mountnfs
+ portmap=no
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ '[' no = yes ']'
+ '[' -n '' ']'
+ rmdir /var/run/network/mountnfs
run-parts: executing /etc/network/if-up.d/ntpdate
+ '[' 2ath0 '!=' lo ']'
+ test -f /usr/sbin/ntpdate
+ '[' -f /etc/default/ntpdate ']'
+ . /etc/default/ntpdate
++ NTPSERVERS=ntp.ubuntu.com
++ NTPOPTIONS=-u
+ test -n ntp.ubuntu.com
+ '[' 1 = 1 ']'
+ echo 'Synchronizing clock to ntp.ubuntu.com...'
Synchronizing clock to ntp.ubuntu.com...
+ /usr/sbin/ntpdate -b -s -u ntp.ubuntu.com
Error : Name or service not known
+ true
run-parts: executing /etc/network/if-up.d/openvpn
+ OPENVPN=/etc/init.d/openvpn
+ '[' '!' -x /etc/init.d/openvpn ']'
+ '[' -n '' ']'
run-parts: executing /etc/network/if-up.d/uml-utilities
+ test -n ''
+ exit 0
Configuring interface 2ath0=2ath0 (inet)
run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/openvpn
run-parts: executing /etc/network/if-down.d/wpasupplicant
+ '[' 2ath0 = lo ']'
+ WPA_SUP_BIN=/sbin/wpa_supplicant
+ WPA_SUP_PNAME=wpa_supplicant
+ WPA_SUP_PIDFILE=/var/run/wpa_supplicant.2ath0.pid
+ WPA_SUP_OPTIONS='-B -P /var/run/wpa_supplicant.2ath0.pid -i 2ath0'
+ WPA_CLI_BIN=/sbin/wpa_cli
+ WPA_CLI_PNAME=wpa_cli
+ WPA_CLI_PIDFILE=/var/run/wpa_cli.2ath0.pid
+ WPA_CLI_ACTFILE=/var/run/wpa_cli.2ath0.action
+ WPA_CLI_OPTIONS='-B -P /var/run/wpa_cli.2ath0.pid -i 2ath0'
+ WPA_COMMON_CTRL_IFACE=/var/run/wpa_supplicant
+ '[' '!' -x /sbin/wpa_supplicant -o '!' -x /sbin/wpa_cli ']'
+ '[' -s '' ']'
+ env
+ grep -q '^IF_WPA'
+ exit 0

ifconfig 2ath0 down
run-parts --verbose /etc/network/if-post-down.d
run-parts: executing /etc/network/if-post-down.d/madwifi-ng
+ WLANCONFIG=/usr/local/bin/wlanconfig
+ '[' '!' -x /usr/local/bin/wlanconfig ']'
+ '[' -z wifi0 ']'
+ /usr/local/bin/wlanconfig 2ath0 destroy
+ exit 0
run-parts: executing /etc/network/if-post-down.d/wireless-tools
+ IWCONFIG=/sbin/iwconfig
+ '[' '!' -x /sbin/iwconfig ']'
+ grep -q 2ath0: /proc/net/dev
+ exit 0
run-parts: executing /etc/network/if-post-down.d/wpasupplicant
+ '[' 2ath0 = lo ']'
+ WPA_SUP_BIN=/sbin/wpa_supplicant
+ WPA_SUP_PNAME=wpa_supplicant
+ WPA_SUP_PIDFILE=/var/run/wpa_supplicant.2ath0.pid
+ WPA_SUP_OPTIONS='-B -P /var/run/wpa_supplicant.2ath0.pid -i 2ath0'
+ WPA_CLI_BIN=/sbin/wpa_cli
+ WPA_CLI_PNAME=wpa_cli
+ WPA_CLI_PIDFILE=/var/run/wpa_cli.2ath0.pid
+ WPA_CLI_ACTFILE=/var/run/wpa_cli.2ath0.action
+ WPA_CLI_OPTIONS='-B -P /var/run/wpa_cli.2ath0.pid -i 2ath0'
+ WPA_COMMON_CTRL_IFACE=/var/run/wpa_supplicant
+ '[' '!' -x /sbin/wpa_supplicant -o '!' -x /sbin/wpa_cli ']'
+ '[' -s '' ']'
+ env
+ grep -q '^IF_WPA'
+ exit 0
Configuring interface 1ath0=1ath0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/madwifi-ng
+ WLANCONFIG=/usr/local/bin/wlanconfig
+ '[' '!' -x /usr/local/bin/wlanconfig ']'
+ '[' -z wifi0 ']'
+ ip link list 1ath0
+ case "$IF_WIRELESS_MODE" in
+ MODE=sta
+ /usr/local/bin/wlanconfig 1ath0 create wlandev wifi0 wlanmode sta
+ exit 0
run-parts: executing /etc/network/if-pre-up.d/uml-utilities
+ test -x /usr/sbin/tunctl
+ test -n ''
+ exit 0
run-parts: executing /etc/network/if-pre-up.d/wireless-bssid
+ case "$METHOD" in
+ IWCONFIG=/sbin/iwconfig
+ '[' -n '' ']'
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
+ IWCONFIG=/sbin/iwconfig
+ '[' '!' -x /sbin/iwconfig ']'
+ '[' -n '' ']'
+ '[' -n managed ']'
+ /sbin/iwconfig 1ath0 mode managed
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n 0123456789abcdef0123456789 ']'
+ eval /sbin/iwconfig 1ath0 key 0123456789abcdef0123456789
++ /sbin/iwconfig 1ath0 key 0123456789abcdef0123456789
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n sven-ola ']'
+ /sbin/iwconfig 1ath0 essid sven-ola
+ '[' -n '' ']'
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
+ '[' 1ath0 = lo ']'
+ WPA_SUP_BIN=/sbin/wpa_supplicant
+ WPA_SUP_PNAME=wpa_supplicant
+ WPA_SUP_PIDFILE=/var/run/wpa_supplicant.1ath0.pid
+ WPA_SUP_OPTIONS='-B -P /var/run/wpa_supplicant.1ath0.pid -i 1ath0'
+ WPA_CLI_BIN=/sbin/wpa_cli
+ WPA_CLI_PNAME=wpa_cli
+ WPA_CLI_PIDFILE=/var/run/wpa_cli.1ath0.pid
+ WPA_CLI_ACTFILE=/var/run/wpa_cli.1ath0.action
+ WPA_CLI_OPTIONS='-B -P /var/run/wpa_cli.1ath0.pid -i 1ath0'
+ WPA_COMMON_CTRL_IFACE=/var/run/wpa_supplicant
+ '[' '!' -x /sbin/wpa_supplicant -o '!' -x /sbin/wpa_cli ']'
+ '[' -s '' ']'
+ env
+ grep -q '^IF_WPA'
+ exit 0

dhclient3 -pf /var/run/dhclient.1ath0.pid -lf /var/lib/dhcp3/dhclient.1ath0.leases 1ath0
Internet Systems Consortium DHCP Client V3.0.3
Copyright 2004-2005 Internet Systems Consortium.
All rights reserved.

wifi0: unknown hardware address type 801
wifi0: unknown hardware address type 801
Listening on LPF/1ath0/00:80:48:41:4e:ee
Sending on   LPF/1ath0/00:80:48:41:4e:ee
Sending on   Socket/fallback
DHCPDISCOVER on 1ath0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on 1ath0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on 1ath0 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 192.168.65.65
DHCPREQUEST on 1ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.65.65
bound to 192.168.65.123 -- renewal in 17498 seconds.
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/mountnfs
+ '[' 1ath0 '!=' lo ']'
+ test -f /etc/fstab
+ '[' -f /etc/default/rcS ']'
+ . /etc/default/rcS
++ TMPTIME=0
++ SULOGIN=no
++ DELAYLOGIN=no
++ UTC=no
++ VERBOSE=no
++ EDITMOTD=yes
++ FSCKFIX=no
+ . /lib/init/functions.sh
+ mkdir /var/run/network/mountnfs
+ portmap=no
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ continue
+ read device mountpt fstype options
+ case "$device" in
+ case "$options" in
+ case "$fstype" in
+ fstype=
+ '[' -n '' ']'
+ read device mountpt fstype options
+ case "$device" in
+ continue
+ read device mountpt fstype options
+ '[' no = yes ']'
+ '[' -n '' ']'
+ rmdir /var/run/network/mountnfs
run-parts: executing /etc/network/if-up.d/ntpdate
+ '[' 1ath0 '!=' lo ']'
+ test -f /usr/sbin/ntpdate
+ '[' -f /etc/default/ntpdate ']'
+ . /etc/default/ntpdate
++ NTPSERVERS=ntp.ubuntu.com
++ NTPOPTIONS=-u
+ test -n ntp.ubuntu.com
+ '[' 1 = 1 ']'
+ echo 'Synchronizing clock to ntp.ubuntu.com...'
Synchronizing clock to ntp.ubuntu.com...
+ /usr/sbin/ntpdate -b -s -u ntp.ubuntu.com
run-parts: executing /etc/network/if-up.d/openvpn
+ OPENVPN=/etc/init.d/openvpn
+ '[' '!' -x /etc/init.d/openvpn ']'
+ '[' -n '' ']'
run-parts: executing /etc/network/if-up.d/uml-utilities
+ test -n ''
+ exit 0