Bug 115342

Summary: atheros cards broken (ifup-wireless generates bad iwconfig lines)
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Dan Winship <danw>
Component: NetworkAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None    
Version: Beta 3   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Dan Winship 2005-09-05 23:59:58 UTC
/etc/sysconfig/network/scripts/ifup-wireless generates invalid iwconfig lines,
at least for atheros cards:

spellbook:/etc/sysconfig/network/scripts # ifup ath0
    ath0      device: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01))
    ath0      configuration: wlan-id-00:05:4e:4b:ed:df
command 'iwconfig ath0 key open a59blahblahblahblahblah [1] key 128 [2] key 128
[3] key 128 [4]' returned
 Error for wireless request "Set Encode" (8B2A) :
    SET failed on device ath0 ; Invalid argument.
setting encryption key FAILED, aborting interface setup


The problem is the call to print_key at (or around) line 239:

   eval WIRELESS_KEY_$i="$(print_key $K $WIRELESS_KEY_LENGTH)"

if $K is empty/unset, then this is equivalent to

   eval WIRELESS_KEY_$i="$(print_key  $WIRELESS_KEY_LENGTH)"

meaning the $WIRELESS_KEY_LENGTH (128) is incorrectly interpreted as a
key (and the key length is defaulted by print_key), resulting in spurious
invalid keys in the iwconfig command.

Changing the line to

   eval WIRELESS_KEY_$i=$(print_key "$K" $WIRELESS_KEY_LENGTH)

fixes it, and I think should not cause any other problems, but I didn't
look carefully, so that might not be quite right.
Comment 1 Joachim Gleissner 2005-09-06 08:43:26 UTC
Is already fixed.